Biomedical Engineering Reference
In-Depth Information
0.8
1
0.6
0.8
0.4
0.6
0.2
0.4
0
0.2
−0.2
0 0
0.01
0.005
1000
2000
Frequency (Hz)
3000
4000
5000
0
Delay (sec)
0.005
0.01
(c)
(d)
FIGURE 11.22, cont'd
(c) Hanning high-pass filter impulse response and magnitude response (d).
EXAMPLE PROBLEM 11.26
Using the digital low-pass and high-pass filters of Example Problem 11.25, filter a white noise
(flat spectrum) signal. Plot the magnitude spectrum of the input and output signals.
Solution
%Filtering the Random Noise Signal
X
¼
randn(1,Fs); %1 second of Random Noise
Y_lp
¼
conv(X,h_lp); %Low-pass Filtered Noise
Y_hp
¼
conv(X,h_hp); %High-pass Filtered Noise
%Plotting Results
subplot(221)
psd(X,1024,Fs); %Input Power spectrum Magnitude
hold on
psd(Y_lp,1024,Fs); %Low-pass Output Power spectrum Magnitude
ch
¼
get(gca,'children')
set(ch(1),'color','k')
set(ch(2),'color',[0.5 0.5 0.5])
subplot(222)
psd(X,1024,Fs); %Input Power spectrum Magnitude
hold on
psd(Y_hp,1024,Fs); %High-pass Output Power spectrum Magnitude
ch
¼
get(gca,'children')
¼
ch
get(gca,'children')
set(ch(1),'color','k')
set(ch(2),'color',[0.5 0.5 0.5])
The results are shown in Figure 11.23.
Search WWH ::




Custom Search