Professional Documents
Culture Documents
DSP Matlab Exercise
DSP Matlab Exercise
xlabel('0<=n<=9');
ylabel('e1[n]');
grid on;
% 0<a<1
a = 0.75;
en2=(a*ones(1,10)).^n;
subplot(3,1,2);
stem(n,en2,'r','filled');
title('discrete-time exponential (0.75)^n');
xlabel('0<=n<=9');
ylabel('e2[n]');
grid on;
% a>1
a = 1.25;
en3=(a*ones(1,10)).^n;
subplot(3,1,3);
stem(n,en3,'r','filled');
title('discrete-time exponential (1.25)^n');
xlabel('0<=n<=9');
ylabel('e3[n]');
grid on;
%% FILTER DESIGN
PROGRAM 4: Plot the magnitude and phase responses of the causal IIR digital
transfer function
. What type of filter does this
transfer function represent? Determine 3dB cutoff frequency from the plot.
B = conv([1 -2 1],[1 -2 1]);
A = conv([1 -1.499 0.8482],[1 -1.5548 0.6493]);
freqz(B,A);
PROGRAM 5: Design a 5th order elliptic IIR lowpass filter with the following
specifications:
Passband edge = 0.4
Passband ripple = 0.5 dB
Min. stopband attenuation = 40 dB
N = input('type in the order = ');
Rp = input('type in the passband ripple = ');
Rs = input('type in the min. stopband attenuation = ');
Wn = input('type in the passband edge frequency = ');
[b,a] = ellip(N,Rp,Rs,Wn);
fvtool(b,a)
PROGRAM 6: Plot
highpass filter
Passband edge =
Passband ripple