Académique Documents
Professionnel Documents
Culture Documents
Page | 2
EXPERIMENT-2
Page | 3
Experiment-3(a)
Page | 4
title('Rectangle Signal x(n)');
subplot(2,1,2);
plot(w/pi,magX);
xlabel('Frequency in pi Units');
ylabel('Magnitude');title('Fourier Transform');
Page | 5
Experiment-3(b)
Page | 6
phase=angle(xk); % Find the phases of individual DFT
points
Page | 7
Experiment-4
Page | 8
Ex
periment-5
Page | 9
subplot(2,2,2);
stem(i2);
xlabel('n');
ylabel('amplitude');
title('second sequence');
N=max(N1,N2);
i1=fft(i1,N);
i2=fft(i2,N);
y=i1.*i2;
y=ifft(y);
subplot(2,2,3);
stem(y);
xlabel('n');
ylabel('amplitude');
title('circular convolution');
DIGITALBUTTERWORTHLOWPASSFILTER
MATLABCODE
>>clc;
>>clearall;
>>closeall;
>>rp=input('enterthepassbandattenuation:');
enterthepassbandattenuation:0.4
Page | 10
>>rs=input('enterthestopbandattenuation:');
enterthestopbandattenuation:30
>>wp=input('enterthepassbandfrequency:');
enterthepassbandfrequency:0.2*pi
>>ws=input('enterthestopbandfrequency:');
enterthestopbandfrequency:0.4*pi
>>[N,wn]=buttord(wp/pi,ws/pi,rp,rs);
>>[b,a]=butter(N,wn);
>>freqz(b,a);
SAMPLEINPUT
Enterthepassbandattenuation0.4
Enterthestopbandattenuation30
Enterthepassbandfrequency0.2*pi
Enterthestopbandfrequency0.4*pi
FIGURE
Page | 11
BUTTERWORTHHIGHPASSFILTER
MATLABCODE
clc;
clearall;
closeall;
rp=input('enterthepassbandattenuation:');
rs=input('enterthestopbandattenuation:');
wp=input('enterthepassbandfrequency:');
ws=input('enterthestopbandfrequency:');
Page | 12
[N,wn]=buttord(wp/pi,ws/pi,rp,rs);
[b,a]=butter(N,wn);
freqz(b,a);
SAMPLEINPUT
enterthepassbandattenuation:0.4
enterthestopbandattenuation:30
enterthepassbandfrequency:0.6*PI
enterthepassbandfrequency:0.6*pi
enterthestopbandfrequency:0.2*pi
FIGURE
Page | 13
Page | 14