0% found this document useful (0 votes)
36 views2 pages

Code For Decimated FFT Fiter Bank

This document contains code for implementing a fast Fourier transform (FFT) filter bank and a decimated FFT filter bank. The FFT filter bank code generates the FFT of an input signal, plots the FFT magnitude, and implements a filter bank by modulating the input with complex exponentials at different frequencies. The decimated FFT filter bank code decimates the input signal, takes the FFT of the decimated signal, and similarly implements a filter bank by modulating the decimated input with complex exponentials. Both codes plot the outputs of the filter banks.

Uploaded by

jeevitharrk
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
36 views2 pages

Code For Decimated FFT Fiter Bank

This document contains code for implementing a fast Fourier transform (FFT) filter bank and a decimated FFT filter bank. The FFT filter bank code generates the FFT of an input signal, plots the FFT magnitude, and implements a filter bank by modulating the input with complex exponentials at different frequencies. The decimated FFT filter bank code decimates the input signal, takes the FFT of the decimated signal, and similarly implements a filter bank by modulating the decimated input with complex exponentials. Both codes plot the outputs of the filter banks.

Uploaded by

jeevitharrk
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

code for fft

filter bank

clc;
clear all;
close all;
N=20;
n=0:1:N-1;
x=ones(1,N);
%plot the input
figure
stem(n,x);
lfft=256;
X1=fft(x,lfft);
X2=real(X1);
%plot thr fft of the input
figure
X2=[(X2(lfft/2:lfft)),X2(1:(lfft/2)-1)];
plot(X2);
%plot the absolute value of the fft of the input
Xf=20*(log10(abs(X1)));
Xf=[(Xf(lfft/2:lfft)),Xf(1:(lfft/2)-1)];
figure
plot(Xf)
k=-100:100;
m=k/100*pi;
X=x*exp(-1j*(n')*m);
figure
plot(m,abs(real(X)));hold on
% plot filter bank
for i=1:N-1
X=x*exp(-1j*(n')*(m+2*i*pi/N));
plot(m,abs(real(X)),'--');
end

code for decimated fft fiter bank


clc;
clear all;
close all;
N=50;
n=0:1:N-1;
x=ones(1,N);
y= decimate(x,2);
%plot the decimated input
figure
stem(y)
lfft=512;
lfft1=512/2;
Y=real(fft(y,lfft1));
Y1=fft(y,lfft1)
%plot the fft of the decimated input
figure
Y2=[(Y(lfft1/2:lfft1)),Y(1:(lfft1/2)-1)];
plot(Y2)

%plot the absolute value of the fft of the input


Yf=20*(log10(abs(Y1)));
Yf=[(Yf(lfft1/2:lfft1)),Yf(1:(lfft1/2)-1)];
figure
plot(Yf)
k=-300:300;
m=k/300*pi;
Y=y*exp(-1j*(n')*m);
figure
plot(m,abs(real(Y)));hold on
% plot filter bank
for i=1:N-1
Y=y*exp(-1j*(n')*(m+2*i*pi/N));
plot(m,abs(real(Y)),'--');
end

You might also like