I am trying to make a function that outputs the following frequency response of an FIR system:
where b is a vector of filter coefficients, w is a vector of angular frequencies, and output H is a complex-valued frequency response. I think I need a for loop to account for the summation, but I am not sure how to go about this (I am a MATLAB novice).
Thanks!

 Réponse acceptée

Jonathan Medina
Jonathan Medina le 22 Fév 2020
Modifié(e) : Jonathan Medina le 22 Fév 2020
I think I figured it out. Any comments/suggestions would be appreciated.
function H = FreqResponse(b,w)
% This function inputs a vector b of filter coefficients and a vector w of
% angular frequencies and outputs a complex-valued frequency response H.
H = zeros(length(b),1);
for k = 1:length(b) %index for filter coeff's
H = H + b(k) * exp(-1j*w*k); %given frequency response
end
end

Plus de réponses (0)

Catégories

En savoir plus sur Get Started with DSP System Toolbox dans Centre d'aide et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by