[SciPy-user] What's "a sequence"

stef mientki s.mientki@mailbox.kun...
Wed Apr 11 14:43:22 CDT 2007


Robert Kern wrote:
> Stef Mientki wrote:
>   
>> hello,
>>
>> I'm trying to design a filter by the Remez exchange algorithm,
>> but don't know how define "a sequence", like the bands parameter.
>>
>>  From the help:
>> remez(numtaps, bands, desired, weight=None, Hz=1, type='bandpass', 
>> maxiter=25, grid_density=16)
>>     Calculate the minimax optimal filter using Remez exchange algorithm.
>>     Inputs:
>>       numtaps -- The desired number of taps in the filter.
>>       bands -- A montonic sequence containing the band edges.  All elements
>>                must be non-negative and less than 1/2 the sampling frequency
>>                as given by Hz.
>>
>> I tried several options
>> i=signal.remez(16, ([0.02,0.06]), ...
>> i=signal.remez(16, [0.02,0.06], ...
>> i=signal.remez(16, (0.02,0.06), ...
>>
>> but they all give an error on the bands-parameter.
>>     
>
> What error? Please always copy-and-paste the traceback.
>
>   
Sorry for not given the traceback and not signing my message (hit the 
enter key by accident).
Anyway found a solution:
i = signal.remez (16, array([0,0.02,0.06,0.5]), ...

Remains an other question, do I need the border elements 0 and 0.5 in 
the sequences for the Remez exchange algorithm ?
I guess yes, because of:
      bands -- A montonic sequence containing the band edges.  All elements
                       must be non-negative and less than 1/2 the 
sampling frequency
                       as given by Hz.
      desired -- A sequency half the size of bands containing the 
desired gain
                 in each of the specified bands

(Coming from MatLab, I'm spoiled to just fill in some boxes ;-)


thanks,
Stef  Mientki



More information about the SciPy-user mailing list