Digital Signal Processing Reference
In-Depth Information
A high-frequency sinusoid would jump from1 to +1, which we simulate. A
nal modication of the lter coecients will be to apply an alternating ip to the
sign of the values.
f2 = d2;
flip = 1;
% flip every other sign
for k=1:length(f2)
if (flip == 1)
f2(k) = -f2(k);
flip = 0;
else
flip = 1;
end
end
When we run this code, our lter coecients will appear as in Figure 10.10. As
the frequency magnitude response shows, the lter now attenuates low frequencies
and passes the high frequencies. Thus, we have created a highpass lter. We can
also have MATLAB give us a highpass lter, again with the fir1 command. Notice
how we use 0.7 instead of 0.3 for the cuto. What would be the result if we left it
as 0.3?
b3 = fir1(taps-1, 0.7, high);
This section gives an overview of windowing functions, and shows why they are
useful. Also, we explored making our own FIR lters both with a MATLAB Signal
Processing toolkit command, as well as our own program. Though this program
uses the window command, also part of the Signal Processing toolkit, it should be
clear to the reader how this could be done without that toolkit.
10.11
Compression
Compression programs take the redundancy out of data to store it in a compact form.
There are lossy compression algorithms, that tolerate some loss of information. For
example, the popular JPEG and MP3 compression standards (les with extensions
of .jpg and .mp3, respectively) do not return an exact copy of the original to the
user, but a version close enough to the original that the user should not notice
the dierence after uncompressing it. Another possibility is a lossless compression
algorithm. Programs such as gzip and winzip store data compactly, but do not lose
Search WWH ::




Custom Search