DSPRelated.com
Forums

Ripple value in Matlab firpmord function?

Started by datu...@gmail.com April 7, 2008
Hi Experts,

I use matlab firpmord function

http://www.mathworks.com/access/helpdesk/help/toolbox/signal/firpmord.html
In help file it give the following example:

rp = 3; % Passband ripple
rs = 40; % Stopband ripple
fs = 2000; % Sampling frequency
f = [500 600]; % Cutoff frequencies
a = [1 0]; % Desired amplitudes
% Compute deviations
dev = [(10^(rp/20)-1)/(10^(rp/20)+1) 10^(-rs/20)];
[n,fo,ao,w] = firpmord(f,a,dev,fs);
b = firpm(n,fo,ao,w);
freqz(b,1,1024,fs);
title('Lowpass Filter Designed to Specifications');

The ripple rp in linear is calculated by "(10^(rp/20)-1)/(10^(rp/20)+1)". I cannot understand how it comes from? If the definition of linear ripple is x. Magnitude is 1. The variation should be 1+x and 1-x and the x should be
x= 1 - 10^(-rp/20);

So I think "1 - 10^(-rp/20)" makes more sense? any one can give me some clues why matlab use (10^(rp/20)-1)/(10^(rp/20)+1)?

Many thanks

Datu