MATLAB: Need to visualise this comb filter

comb filterdifference equationfreqziirMATLABz transform

I need to visualise this schroeder comb filter – y_n=x_(n-tau)+g*y(n-tau). I have that the z-transfer function is H(z)=1/(z^tau – g).
I don't really know how to do this – any help would be greatly appreciated.
Many thanks

Best Answer

You can visualize it in pole-zero form, or the phase, magnitude etc, which evaluates it on the unit circle.
However, you should rewrite it in the form:
H(z) = z^{-\tau}/1-gz^{-\tau}
I'll assume tau = 3 here and g = 1/2. The actual value of g will determine whether the filter is stable and therefore whether it has a Fourier transform. The first element of the numerator, B, and denominator, A, coefficient vectors is the 0-th order term in the Z-transform.
g = 1/2;
B = [0 0 0 1];
A = [1 0 0 -g];
%pole-zero plot
zplane(B,A)
% magnitude and phase response
freqz(B,A)
Related Question