<< Chapter < Page | Chapter >> Page > |
Notice in the previous
Scope
output that the process of
upsampling causes a decrease in the energy of thesample-and-hold representation by a factor of 4. This is
the reason for using the
Gain
block.
Now determine the gain factor of the
Gain
block and
the cutoff frequency of the
Discrete-time LP filter
needed to produce the desired
interpolated signal.Run the simulation and observe the behavior of the system.
After you get an accurate plot ofthe output frequency spectrum,
print the output of the
Spectrum Analyzer
.
Identify the change in the location ofthe aliased components in the output signal.
For the following section, download the file music.au . For help on how to load and play sudio signals select the link.
In the previous section, we used interpolation to increase the sampling rate of a discrete-time signal.However, we often have the opposite problem in which the desired sampling rate is lower than the sampling rateof the available data. In this case, we must use a process called decimation to reduce the sampling rate of the signal.
Decimating , or downsampling , a signal by a factor of is the process of creating a new signal by taking only every sample of . Therefore is simply . The frequency domain relationship between and can be shown to be the following:
Notice the similarity of [link] to the sampling theorem equation in [link] . This similarity should be expected because decimation is the processof sampling a discrete-time signal. In this case, is formed by taking in the interval and expanding it in frequency by a factor of D. Then it is repeated in frequency every , and scaled in amplitude by . For similar reasons as described for equation [link] , aliasing will be prevented if in the interval , is zero outside the interval . Then [link] simplifies to
A system for decimating a signal is shown in [link] . The signal is first filtered using a low pass filterwith a cutoff frequency of rad/sample. This insures that the signal is band limited so that the relationshipin [link] holds. The output of the filter is then subsampledby removing every other sample.
For the following section download
music.au .
Read in the signal contained in
music.au
using
auread
,
and then play it back with
sound
.
The signal contained in
music.au
was sampled at 16 kHz,
so it will sound much too slow when played backat the default 8 kHz sampling rate.
To correct the sampling rate of the signal,
form a new signal, sig1, by
selecting every other sample of the music vector.Play the new signal using
sound
, and
listen carefully to the new signal.
Next compute a second subsampled signal, sig2 ,by first low pass filtering the original music vector using a discrete-time filter of length 20, andwith a cutoff frequency of . Then decimate the filtered signal by 2,and listen carefully to the new signal.
output = conv(s,h)
, where
s
is the signal,
and
h
is the impulse response of the desired filter.
To design a length
low-pass filter with cutoff frequency
W
rad/sample,
use the command
h = fir1(M,W/pi)
.Notification Switch
Would you like to follow the 'Purdue digital signal processing labs (ece 438)' conversation and receive update notifications?