Professional Documents
Culture Documents
Frequency Domain Signal Processing Using MATLAB
Frequency Domain Signal Processing Using MATLAB
d)
d)
Chebyshev Filter
Chebyshev Filter
having a steeper roll-off and more
passband/stopband ripple than Butterworth
filters
Chebyshev filters have the property that they
minimize the error between the idealized filter
characteristic and the actual over the range of
the filter, but with ripples in the passband or
stopband.
Chebyshev Filter (Cont
Chebyshev Filter (Cont
d)
d)
Chebyshev Type I
It has no ripple in the stopband, but has
ripple in the passband. The transfer function
is:
where Tn() is a chebyshev polynomial.
Chebyshev Filter (Cont
Chebyshev Filter (Cont
d)
d)
Chebyshev Type II
It has no ripple in the passband, but has
ripple in the stopband. The transfer function
is:
where Tn() is a chebyshev polynomial
Chebyshev Filter (Cont
Chebyshev Filter (Cont
d)
d)
Elliptic Filter
Elliptic Filter
is a filter with equiripple behavior in
both the passband and the stopband.
It minimizes the maximum error in both
bands, as opposed to a Chebyshev filter
which exhibits equiripple behavior in the
passband, or the inverse Chebyshev filter
which has ripples in the stopband.
Elliptic Filter (Cont
Elliptic Filter (Cont
d)
d)
The magnitude of the frequency response of
a lowpass elliptic filter is given by:
where Rn() is a chebyshev rational function.
Elliptic Filter (Cont
Elliptic Filter (Cont
d)
d)
Filters : Comparison
Filters : Comparison
Butterworth Filter
Butterworth Filter
butter designs lowpass, bandpass, highpass,
and bandstop digital and analog Butterworth
filters.
[B,A] = BUTTER(N,Wn) designs an Nth order
lowpass digital Butterworth filter and returns
the filter coefficients in length N+1 vectors B
(numerator) and A (denominator). The cutoff
frequency Wn must be 0 <Wn < 1.0.
Butterworth Filter (Cont
Butterworth Filter (Cont
d)
d)
If Wn is a two-element vector, Wn = [W1 W2],
BUTTER returns an order 2N bandpass filter
with passband W1 < W < W2.
[B,A] = BUTTER(N,Wn,'high') designs a
highpass filter.
[B,A] = BUTTER(N,Wn,'low') designs a lowpass
filter.
[B,A] = BUTTER(N,Wn,'stop') is a bandstop
filter if Wn = [W1 W2].
Chebyshev Filter
Chebyshev Filter
[b,a] = cheby1(n,R,Wp) designs an order n
Chebyshev lowpass digital Chebyshev filter
with normalized passband edge frequency Wp
and R dB of peak-to-peak ripple in the
passband.
Normalized passband edge frequency is the
frequency at which the magnitude response of
the filter is equal to -R dB.
Butterworth Example
Butterworth Example
[b,a]=butter(7,.32);
[H,w]=freqz(b,a,128);
plot(w,abs(H));
Filter Design with
Filter Design with
Parks
Parks
-
-
McClellan
McClellan
FRIPM command designs a linear-phase FIR
filter using the Parks-McClellan algorithm.
Chebyshev approximation is used to fit the
optimal fit between desired and actual
response.
b = firpm(n,f,a): returns n+1 coefficients of
the order n FIR filter whose frequency-
amplitude characteristics match those given
by vectors f and a.
Filter Design with
Filter Design with
Parks
Parks
-
-
McClellan (Cont
McClellan (Cont
d)
d)
f is a vector of pairs of normalized frequency
points, specified in the range between 0 and
1 in increasing order.
a is a vector containing the desired
amplitudes at the points specified in f.
f and a must be the same length. The length
must be an even number.
Filter Design with
Filter Design with
Parks
Parks
-
-
McClellan (Cont
McClellan (Cont
d)
d)
The desired amplitude at frequencies
between pairs of points (f(k), f(k+1)) for k odd
is the line segment connecting the points
(f(k), a(k)) and (f(k+1), a(k+1)).
The desired amplitude at frequencies
between pairs of points (f(k), f(k+1)) for k
even is unspecified. The areas between such
points are transition or "don't care" regions.
Example of
Example of
FIRPM Filter Design
FIRPM Filter Design
f = [0 0.3 0.4 0.6 0.7 1];
a = [0 0 1 1 0 0];
b = firpm(17,f,a);
[h,w] = freqz(b,1,512);
How to read a sound
How to read a sound
[y,Fs,bits] = wavread('filename',[N1 N2])
Read Microsoft WAVE (.wav) sound file
specified in the filename and load its data to
vector y ( samples N1 through N2).
Fs returns the sampling frequency and bits
returns the number of bits used for encoding.
How to write a signal as a sound
How to write a signal as a sound
wavwrite(y,Fs,N,'filename')
writes the data stored in the variable y to a
WAVE file called filename. Fs is sample
rate and N is the number of bits used for
encoding. Amplitude values outside the
range [-1,+1] are clipped prior to writing.
N = 8, 16, 24, or 32
How to make a sound noisy!
How to make a sound noisy!
By using wavread command, first we
convert a sound into a vector, then we
add noise term to it.
Common forms of noises are Gaussian
and Uniform.
Gaussian Noise
Gaussian Noise
Gaussian Noise
Y = randn(m,n) generates normally
distributed random numbers (noises)
In order to generate a Gaussian noise
sequence with arbitrary statistics, multiply
the output of randn by the standard
deviation and then add the desired mean
Uniform
Uniform
Noise
Noise
Uniform Noise
Y = rand (m,n) generates unifromly
distributed random numbers (noises) over
[0,1] interval.
In order to generate a uniform distribution of
random numbers on a specified interval
[a,b], multiply the output of rand by (b-a),
then add a.
Questions
Questions
surely, in the creation of the heavens
and the earth, there are signs for the
owners of wisdom
The Holy Quran
Thanks for your attendance.