DSP Da4
DSP Da4
OF TECHNOLOGY
QUESTION-1:
AIM- Design a Butterworth Low pass filter with cut off
frequency of 300 Hz and pass the signal cos(2π*100t) +
cos(2π*500t) to obtain the lower frequency component of the
same.
MATLAB CODE-
clc
fc=300;
t=0:0.001:0.05;
signal = cos(2*pi*100*t)+cos(2*pi*500*t);
plot(t,signal);
wc=2*pi*fc;
N=5;
[x,y] = butter(N,wc,'s');
h=freqs(x,y);
figure
plot(abs(h));
h1=tf(x,y);
y=lsim(signal,h1,t);
figure
plot(t,y);
MATLAB SIMULATION-
QUESTION-2:
Algorithm-
1. Define all the specification.
2. Find the N using the order formula.
3. Find the numerator and denominator coefficients of
Butterworth filter using the keyword butter.
4. Convert the analog to digital using impinvar function
5. Find the transfer of digital filter
MATLAB CODE-
clc
ap=4.436;
as=20;
wp=0.35*pi;
ws=0.7*pi;
t=0.1;
wp1=wp/t;
ws1=ws/t;
l=(10.^(0.1*as)-1)^(0.5);
e=(10.^(0.1*ap)-1)^(0.5);
x=log(l/e);
y=log(ws1/wp1);
n=x/y;
N=ceil(n);
fs=100;
wc=wp1/(e)^(1/N);
[b,a]=butter(N,wc/fs);
[bz,az]=impinvar(b,a,fs);
H=impz(bz,az);
disp(bz);
disp(az);
MATLAB SIMULATION-
QUESTION-3:
MATLAB CODE-
clc
fs=1000;
wc=300;
[x,y] = cheby1(6,10,wc/fs/2);
freqz(x,y);
noise = rand(1,1000);
f=filter(x,y,noise);
%freqz(f);
MATLAB SIMULATION-
QUESTION-4:
MATLAB SIMULATION-