Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
DSP LAB
MANUAL
Instructor: Muhammad Usman
Steps:
Kit should be disconnected.
Matlab code
clc
clear all
close all
ftype='low';
ord=4;
w=2*pi*1000;
fs=8000;
cf='s';
f=linspace(0,3000);
[b,a]=butter(ord,w,ftype,cf);
ha=freqs(b,a,2*pi*f);
plot(f,20*log10(abs(ha)))
xlabel('frequency');
ylabel('Amplitude in db')
hold on
[d,c]=bilinear(b,a,fs);
hd=freqz(d,c,f,fs);
plot(f,20*log10(abs(hd)),'r');
grid minor
Matlab code
clc
clear all
close all
ftype='low';
ord=5;
w=2*pi*1500;
fs=8000;
cf='s';
f=linspace(0,3000);
[b,a]=butter(ord,w,ftype,cf);
ha=freqs(b,a,2*pi*f);
plot(f,20*log10(abs(ha)))
xlabel('frequency');
ylabel('Amplitude in db')
hold on
[d,c]=bilinear(b,a,fs);
hd=freqz(d,c,f,fs);
plot(f,20*log10(abs(hd)),'r');
grid minor
Matlab code
clc
clear all
close all
ftype='low';
ord=4;
w=2*pi*1000;
fs=16000;
cf='s';
f=linspace(0,3000);
[b,a]=butter(ord,w,ftype,cf);
ha=freqs(b,a,2*pi*f);
plot(f,20*log10(abs(ha)))
xlabel('frequency');
ylabel('Amplitude in db')
hold on
[d,c]=bilinear(b,a,fs);
hd=freqz(d,c,f,fs);
plot(f,20*log10(abs(hd)),'r');
grid minor
Matlab code
clc
clear all
close all
ftype='low';
ord=5;
w=2*pi*1500;
fs=16000;
cf='s';
f=linspace(0,3000);
[b,a]=butter(ord,w,ftype,cf);
ha=freqs(b,a,2*pi*f);
plot(f,20*log10(abs(ha)))
xlabel('frequency');
ylabel('Amplitude in db')
hold on
[d,c]=bilinear(b,a,fs);
hd=freqz(d,c,f,fs);
plot(f,20*log10(abs(hd)),'r');
grid minor
Matlab code
clc
clear all
close all
ftype='high';
ord=4;
w=2*pi*1000;
fs=16000;
cf='s';
f=linspace(0,3000);
[b,a]=butter(ord,w,ftype,cf);
ha=freqs(b,a,2*pi*f);
plot(f,20*log10(abs(ha)))
xlabel('frequency');
ylabel('Amplitude in db')
hold on
[d,c]=bilinear(b,a,fs);
hd=freqz(d,c,f,fs);
plot(f,20*log10(abs(hd)),'r');
grid minor
Matlab code
clc
clear all
close all
ftype='high';
ord=5;
w=2*pi*1500;
fs=16000;
cf='s';
f=linspace(0,3000);
[b,a]=butter(ord,w,ftype,cf);
ha=freqs(b,a,2*pi*f);
plot(f,20*log10(abs(ha)))
xlabel('frequency');
ylabel('Amplitude in db')
hold on
[d,c]=bilinear(b,a,fs);
hd=freqz(d,c,f,fs);
plot(f,20*log10(abs(hd)),'r');
grid minor
Matlab code
clc
clear all
close all
ftype='high';
ord=4;
w=2*pi*1000;
fs=24000;
cf='s';
f=linspace(0,3000);
[b,a]=butter(ord,w,ftype,cf);
ha=freqs(b,a,2*pi*f);
plot(f,20*log10(abs(ha)))
xlabel('frequency');
ylabel('Amplitude in db')
hold on
[d,c]=bilinear(b,a,fs);
hd=freqz(d,c,f,fs);
plot(f,20*log10(abs(hd)),'r');
grid minor
Matlab code
clc
clear all
close all
ftype='high';
ord=5;
w=2*pi*1500;
fs=24000;
cf='s';
f=linspace(0,3000);
[b,a]=butter(ord,w,ftype,cf);
ha=freqs(b,a,2*pi*f);
plot(f,20*log10(abs(ha)))
xlabel('frequency');
ylabel('Amplitude in db')
hold on
[d,c]=bilinear(b,a,fs);
hd=freqz(d,c,f,fs);
plot(f,20*log10(abs(hd)),'r');
grid minor