Digital Signal Processing Reference
In-Depth Information
0
0
−20
−20
−40
−40
−60
−60
−80
−80
−100
4
6
1 0
2
1 0
f (kHz)
f (kHz)
(a)
(b)
Fig. 17.11. Highpass filtering of
the audio signal stored in the
bell.wav file. (a) Frequency
characteristics of a 64-tap FIR
highpass filter, with cut-off
frequency of 4000 Hz, designed
using a Hamming window.
(b) Power spectrum of the
filtered signal.
>> HHpf = freqz(fHp,1,w);
% transfer function
>> plot(w*Fs/(2*pi),20*log10
% magnitude spectrum
(abs(HHpf) + eps));
The magnitude spectrum of the highpass filter is plotted in Fig. 17.11(a), which
filters the bell sound using the following code:
>> xHpf = filter(fHp,1,x); % Highpass filtered audio
% signal
>> sound(xHpf,Fs) % play the sound
>> nfft=1024; nwind=1024; noverlap=512;
>> [Pxx, F] = psd(xHpf,nfft, Fs,hanning(nwind),noverlap);
>> plot(F,10*log10(P xx + eps));
The power spectrum of the highpass filtered signal is shown in Fig. 17.11(b),
where we observe that the frequency components below 4 kHz are strongly
attenuated. The higher frequency components are left unattenuated. The obser-
vation is confirmed on playing the filtered sound, which sounds shriller, with a
higher pitch than the original bell sound.
Example 17.4 demonstrates the effects of lowpass, bandpass, and highpass
filtering on an audio signal. The following example uses a bandstop filter to
eliminate noise from a noisy signal.
Example 17.5
Consider the audio signal stored in the testaudio3.wav file with the time-
domain representation shown in Fig. 17.12(a). The audio signal is sampled at
a sampling rate of 22 050 samples/s. Using the average periodogram method
discussed in Section 17.1.5, the power spectral density of the audio signal
is estimated and plotted in Fig. 17.12(b). From the power spectral density
plot, we observe that there is a sharp peak at 8 kHz, which is identified as
noise corrupting the audio signal. The noise can be heard if we play the audio
signal.
To suppress the noise, we use a bandstop filter of order 128 with a stop band
that ranges from 7800-8200 Hz. The order of the bandstop filter is chosen
arbitrarily in this example. In more sophisticated applications, the order is
Search WWH ::




Custom Search