Skip to content
This repository was archived by the owner on Feb 2, 2021. It is now read-only.

Commit 30070b0

Browse files
author
Tim Harder
committed
Filter Wizard: simplify updating Tx PLL multiplier after DAC divider switch
We use the previously determined value for the Rx PLL multiplier instead of recalculating.
1 parent 0fc2a0c commit 30070b0

File tree

3 files changed

+9
-47
lines changed

3 files changed

+9
-47
lines changed

AD9361_Filter_Wizard/AD9361_Filter_Wizard.m

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -192,10 +192,7 @@ function AD9361_Filter_Wizard_OpeningFcn(hObject, eventdata, handles, varargin)
192192
DAC_div = ADC_rate / DAC_rate;
193193
if ~(handles.input_tx.DAC_div == DAC_div)
194194
handles.input_tx.DAC_div = DAC_div;
195-
handles.input_tx.PLL_mult = fastest_FIR([64 32 16 8 4 2 1], ...
196-
handles.MAX_BBPLL_FREQ, handles.MIN_BBPLL_FREQ, ...
197-
handles.input_tx.Rdata * handles.input_tx.FIR * handles.input_tx.HB1 * ...
198-
handles.input_tx.HB2 * handles.input_tx.HB3 * handles.input_tx.DAC_div);
195+
handles.input_tx.PLL_mult = handles.input_rx.PLL_mult;
199196
filter_type = get(handles.filter_type, 'Value');
200197
set(handles.filter_type, 'Value', 0);
201198
handles.input_tx.caldiv = default_caldiv(handles);

AD9361_Filter_Wizard/cook_input.m

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,14 @@
205205

206206
cooked = input;
207207

208+
function rate = fastest_FIR(rates, max, min, mult)
209+
for i = 1:length(rates)
210+
if max >= mult * rates(i) && min <= mult * rates(i)
211+
break;
212+
end
213+
end
214+
rate = rates(i);
215+
208216
function caldiv = default_caldiv(input)
209217
if strcmp(input.RxTx, 'Rx')
210218
wnom = 1.4 * input.Fstop; % Rx

AD9361_Filter_Wizard/fastest_FIR.m

Lines changed: 0 additions & 43 deletions
This file was deleted.

0 commit comments

Comments
 (0)