Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- passband_edge = 0.2*pi;
- stopband_edge = 0.3*pi;
- passband_attenuation = 0.3;
- stopband_attenuation = 30;
- Td = 1;
- % Calculating Omega = omega/Td for passband and stopband
- pass_frequency = passband_edge/Td;
- stop_frequency = stopband_edge/Td;
- % getting minimum order of filter as well as cutoff-frequency
- [n, cf] = cheb2ord(pass_frequency, stop_frequency, passband_attenuation, stopband_attenuation, 's');
- % Getting transferfunction of continous filter
- [b, a] = cheby2(n, stopband_attenuation, cf, 'low', 's');
- transferfunction = tf(b, a);
- % using impulse invarianse and sampling with Td to achieve digital filter using impulse invarians
- [num_impulse, den_impulse] = impinvar(b, a, 1/Td);
- Hz_impulse = tf(num_impulse, den_impulse, 1/Td);
- % getting digital filter using bilinear transform
- [num_bilinear, den_bilinear] = bilinear(b, a, 1/Td);
- Hz_bilinear = tf(num_bilinear, den_bilinear, 1/Td);
- %%% Plotting filter designed using impulse invarians
- freqz(num_impulse, den_impulse)
- freqz(num_bilinear, den_bilinear)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement