cannot use element wise operator in frequency response?
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
SimTec
el 24 de Ag. de 2022
Comentada: Bruno Luong
el 24 de Ag. de 2022
Hi guys,
I am trying to get the requency response of the averaging FIR filter using the element wise operator, code below:
Fs=8e3; % sampling frequency
Fc=170; % cutoff frequency
alpha=1-2*pi*Fc/Fs;
nb=round(log2(1/(1-alpha))); % number of shift to the right correspending to multiplication by alpha
NbPoints=1000;
Ndec=Fs/2/1000;
Fstart=1;
i=1:Ndec*NbPoints;
freq=Fstart*10.^(i/NbPoints);
H_f=(1-alpha)*cos(pi.*freq/Fs)/sqrt(1+(alpha^2)-2*alpha*cos(2*pi.*freq/Fs));
semilogx(freq,20*log10(abs(H_f)))
the problem the H_f provides me only one output and not the vector result. how can I fix this.
3 comentarios
Respuesta aceptada
Abderrahim. B
el 24 de Ag. de 2022
Fs=8e3; % sampling frequency
Fc=170; % cutoff frequency
alpha=1-2*pi*Fc/Fs;
nb=round(log2(1/(1-alpha))); % number of shift to the right correspending to multiplication by alpha
NbPoints=1000;
Ndec=Fs/2/1000;
Fstart=1;
i=1:Ndec*NbPoints;
freq=Fstart*10.^(i/NbPoints)
H_f=(1-alpha)*cos(pi.*freq/Fs)./sqrt(1+(alpha^2)-2*alpha*cos(2*pi.*freq/Fs))
semilogx(freq,20*log10(abs(H_f)))
0 comentarios
Más respuestas (0)
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!