DSP Session1 (17) CodesA
DSP Session1 (17) CodesA
subplot(2,1,2);
plot(w/(2*pi), angle(H)*180/pi);
title('Phase Response');
xlabel('Frequency (Hz)');
ylabel('Phase (degrees)');
grid on;
Results:
The results of running the MATLAB code show the magnitude and phase response of
the designed Butterworth lowpass filter. The filter meets the specified requirements
for cutoff frequency and stopband attenuation.
Conclusion:
In conclusion, the digital Butterworth lowpass filter has been successfully designed
using the bilinear transformation method in MATLAB. The filter exhibits the desired
characteristics, with a cutoff frequency of 4 kHz and a minimum stopband
attenuation of 45 dB at 20 kHz. The magnitude and phase response plots
demonstrate the effectiveness of the designed filter in achieving the desired
frequency response.
2.Design a Type I Chebyshev lowpass filter operating at a sampling rate of 80 kHz
with a 0.5-dB cutoff frequency at 4 kHz and a minimum stopband attenuation of 45
dB at 20 kHz using bilinear transformation method. Design the analog prototype
using cheb1ap. Use zp2tf to convert the poles and zeros you obtain to a transfer
function and then use lp2lp to transform the filter to desired cut-off. Get the
discrete-time filter using bilinear Plot the magnitude and phase response of the
designed filter.
Introduction (Problem Statement):
The task is to design a Type I Chebyshev lowpass filter with specific characteristics.
The filter should operate at a sampling rate of 80 kHz, with a cutoff frequency of 4
kHz and a minimum stopband attenuation of 45 dB at 20 kHz. The bilinear
transformation method is to be employed for the design process.
Related Theory:
Type I Chebyshev filters are a class of analog or digital filters known for their
equiripple behavior in the passband and a sharp transition from the passband to the
stopband. The bilinear transformation method is commonly used to convert analog
filter designs to digital filters while preserving certain characteristics such as stability
and frequency response.
Algorithms/Calculation:
1.Design the Analog Prototype:
Use the cheb1ap function to design the analog prototype Chebyshev Type I filter with
the specified characteristics.
2.Convert Poles and Zeros to Transfer Function:
Use the zp2tf function to convert the poles and zeros of the analog filter prototype to
a transfer function.
3.Transform the Filter:
Use the lp2lp function to transform the filter from the analog cutoff frequency to the
desired cutoff frequency.
4.Get the Discrete-Time Filter:
Use the bilinear transformation method to convert the analog filter to a discrete-time
filter.
5.Plot Magnitude and Phase Response:
Use the freqz function to compute the frequency response of the filter.
6.Plot the magnitude and phase response of the designed filter.
Source Codes:
Here's the MATLAB code:
close all;
% Define filter specifications
fs = 80000; % Sampling frequency
fc = 4000; % Cutoff frequency
stop_atten = 45; % Stopband attenuation
Wp = fc / (fs/2); % Relative cutoff frequency
Conclusion:
In conclusion, the Type I Chebyshev lowpass filter has been successfully designed
using the bilinear transformation method in MATLAB. The filter exhibits the desired
characteristics, with a cutoff frequency of 4 kHz and a minimum stopband
attenuation of 45 dB at 20 kHz. The magnitude and phase response plots
demonstrate the effectiveness of the designed filter in achieving the desired
frequency response.
3. Design an Elliptic lowpass filter operating at a sampling rate of 80 kHz with a 0.5-
dB cutoff frequency at 4 kHz and a minimum stopband attenuation of 45 dB at 20
kHz using bilinear transformation method. Design the analog prototype using
ellipap. Use zp2tf to convert the poles and zeros you obtain to a transfer function
and then use lp2lp to transform the filter to desired cut-off. Get the discrete-time
filter using bilinear. Plot the magnitude and phase response of the designed filter.
Algorithms/Calculation:
1.Determine the filter order based on specifications.
2.Design the analog prototype using the ellipap function.
3.Convert poles and zeros to a transfer function using zp2tf.
4.Transform the filter to the desired cutoff frequency using lp2lp.
5.Obtain the discrete-time filter using the bilinear transformation method.
6.Plot the magnitude and phase responses of the designed filter.
Source Codes:
Close all;
Conclusion:
In conclusion, the design of the Elliptic lowpass filter using the bilinear
transformation method in MATLAB has been successful in meeting the specified
requirements. The filter's performance in terms of magnitude and phase responses
aligns with the desired characteristics, indicating its suitability for the intended signal
processing application. Elliptic filters provide a valuable tool for achieving sharp
cutoffs and precise frequency response shaping in digital signal processing systems.