how linear fir algorithm works?
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
shalini singh
le 19 Avr 2020
Réponse apportée : Prabhan Purwar
le 26 Avr 2020
function [y,z] = fir_filt_linear_buff(b,x,z)
y = zeros(size(x));
for n=1:length(x)
z = [x(n); z(1:end-1)];
y(n) = b * z;
end
end
in this why z is used?
i dont understand the need to use z.
please help
0 commentaires
Réponse acceptée
Prabhan Purwar
le 26 Avr 2020
Hi,
hope this example is leveraged from the following link:
The following function represents an FIR filter with a linear buffer, where b is a row vector and z is a column vector the same length as b. x represents the input signal, b represents the filter coefficients and z represents delay/buffer in the signal.
For example:
x=[1 2 3 4 5]; % Signal
b=[1 1 1 1 1]; % Filter Coefficients, kept as unity to demonstrate effect of z
z=[0 0 0 1 0]'; % Delay/buffer
y = zeros(size(x));
for n=1:length(x)
z = [x(n); z(1:end-1)];
y(n) = b * z
end
If z=[0 0 0 0 0]' (No delay) y=[1 3 6 10 15] (FIR Output) as expected
If z=[0 0 0 1 0]' (Delay of 1 at 4th col) y=[2 3 6 10 15]
If z=[0 0 1 0 0]' (Delay of 1 at 3rd col) y=[2 4 6 10 15]
if z=[0 1 0 0 0]' (Delay of 1 at 2nd col) y=[2 4 7 10 15]
if z=[1 0 0 0 0]' (Delay of 1 at 1st col) y=[2 4 7 11 15]
For more details refer to the FIR Filter Structures.
Hope it helps!!
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Digital Filter Analysis dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!