analogdevicesinc / ad936x-filter-wizard

MATLAB-based FIR filter design
Other
50 stars 40 forks source link

Error when only assign input.FIR #11

Closed kele14x closed 3 years ago

kele14x commented 7 years ago

Hi,

I want use _designfilter.m function to design a lowpass filter fo ad9361. According to the comment header of the file, I assign Rdata, FIR and other variables to input, how ever I got an error:

Reference to non-existent field 'HB1'.

Error in cook_input>autoselect_rates (line 234)
input.converter_rate = input.Rdata * input.FIR * input.HB1 * input.HB2 * input.HB3;

Error in cook_input (line 132)
input = autoselect_rates(input, bounds, false);

Error in internal_design_filter (line 64)
input = cook_input(input);

Error in design_filter (line 60)
output = clean_filter_fields(internal_design_filter(input));

Quickest way to see this, run:

input.FIR = 2;
design_filter(input)

Seems I must assign all HBx factor before call the function. I just want FIR interpolation factor = 2, and want the function design the left things. How could I do it?

rgetz commented 7 years ago

Before the FIR can be designed - the other half bands need to be set up -- otherwise, the FIR doesn't know what to compensate for...

So this is working as designed. Does that make sense?

-Robin

kele14x commented 7 years ago

@rgetz Thanks for your reply.

So the auto design first let HB3 be max, then HB2, HB1, last FIR? This usually get FIR = 1.

And the doc is wrong, I must manually controll all the HBx if I want FIR be 2 or 4?

rgetz commented 7 years ago

Hi.

You want to run the ADC as fast as possible, and have the maximum decimation possible. That is the only way to get the max performance of the converter chain. (assuming that you do not violate any of the max/min ranges for the various half bands & FIR).

-Robin