Simple Frequency Response Function

6 次查看(过去 30 天)
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!

采纳的回答

Jonathan Medina
Jonathan Medina 2020-2-22
编辑:Jonathan Medina 2020-2-22
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

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Digital Filter Analysis 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by