Filtering code- unknown filter
Mostrar comentarios más antiguos
Hi to all,
I have a code which filters the signal 'x' with length of N, but I don't know what kind of filtering that is? The code is:
%Filtering.
fL=5; % Setting fL
if fL>1
for i=fL+1:N
x(i-fL)=0;
for j=1:fL
x(i-fL) = x(i-fL)+(1/fL)*x(i-j+1);
end
end
end
Can you help me to know that? thanks,
2 comentarios
Azzi Abdelmalek
el 17 de Ag. de 2012
you should specify what is N?
Coo Boo
el 17 de Ag. de 2012
Respuesta aceptada
Más respuestas (1)
Azzi Abdelmalek
el 17 de Ag. de 2012
Editada: Azzi Abdelmalek
el 17 de Ag. de 2012
x=rand(104,1);y=x
N=size(x,1);
fL=5; % Setting fL
if fL>1
for i=fL+1:N
x(i-fL)=0;
for j=1:fL
x(i-fL) = x(i-fL)+(1/fL)*x(i-j+1);
end
end
end
cla;plot(abs(fft(x)));hold on ;plot(abs(fft(y)),'r')
it seems to be a low pass filter, comparing the Fourier transform of x and y

your original: red
your filtred signal: blue
3 comentarios
Coo Boo
el 17 de Ag. de 2012
Azzi Abdelmalek
el 17 de Ag. de 2012
just look at the half of the plot (from 0 to 52), because froù 53 to 104 it's just a symetric
Categorías
Más información sobre z-transforms en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!