user1876942
user1876942

Reputation: 1501

Filter coefficients with firpm

I am using the Matlab function here:

https://www.mathworks.com/help/signal/ref/firpm.html?searchHighlight=firpm

I have been told to use the following:

h = firpm(62, [0 0.09 0.19 1], [1 1 0 0], [1 300], {20});

The trouble I have is that the person who wrote that is no longer around and I am having problems to understand what "[1 300], {20}" means. I think I don't need them but would like to understand them before I dismiss those.

Upvotes: 0

Views: 372

Answers (1)

bjornruffians
bjornruffians

Reputation: 701

The example at your link "FIR Bandpass Filter with Asymmetric Attenuation" seems good for explaining what the weights ([1 300] in your case) do. If you care less about how well certain sections of your filter emulate the desired response, you can weight them lower. In the example, they seem to care most about the upper stopband having lots of rejection so it's weighted highest.

{20} is the lgrid argument, which controls frequency density per the manual.

Upvotes: 1

Related Questions