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

Commit 2c6b28f

Browse files
author
Tim Harder
committed
Filter Wizard: pass caldiv from Filter Wizard to design functions
Signed-off-by: Tim Harder <timothy.harder@analog.com>
1 parent b9006b5 commit 2c6b28f

File tree

5 files changed

+7
-17
lines changed

5 files changed

+7
-17
lines changed

AD9361_Filter_Wizard/AD9361_Filter_Wizard.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -957,6 +957,7 @@ function create_filter(hObject, handles)
957957
filter_input.PLL_mult = sel.PLL_mult;
958958
filter_input.phEQ = sel.phEQ;
959959
filter_input.wnom = value2Hz(handles, handles.freq_units, str2double(get(handles.Fcutoff, 'String')));
960+
filter_input.caldiv = caldiv;
960961
filter_input.int_FIR = get(handles.Use_FIR, 'Value');
961962
filter_input.RFbw = RFbw;
962963
filter_input.converter_rate = converter_rate;
@@ -2812,7 +2813,6 @@ function Fcenter_CreateFcn(hObject, eventdata, handles)
28122813
set(hObject,'BackgroundColor','white');
28132814
end
28142815

2815-
28162816
% --- Executes during object creation, after setting all properties.
28172817
function results_Apass_CreateFcn(hObject, eventdata, handles)
28182818
% hObject handle to results_Apass (see GCBO)

AD9361_Filter_Wizard/internal_designrxfilters9361_default.m

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
FIR_decim = a.FIR;
5050
HB_decim = a.HB1*a.HB2*a.HB3;
5151
PLL_multr = a.PLL_mult;
52+
caldiv = a.caldiv;
5253

5354
Fadc = Fout * FIR_decim * HB_decim;
5455
clkPLL = Fadc * PLL_multr;
@@ -64,9 +65,6 @@
6465

6566
% Define the analog filters
6667
if ~wnom
67-
wnom = 1.4*Fpass;
68-
div = ceil((clkPLL/wnom)*(log(2)/(2*pi)));
69-
caldiv = min(max(div,3),511);
7068
wc = (clkPLL/caldiv)*(log(2)/(2*pi));
7169
else
7270
wc = wnom;
@@ -376,4 +374,4 @@
376374
tohwrx.CoefficientSize = length(h);
377375
tohwrx.Decimation = FIR_decim;
378376
tohwrx.Gain = gain;
379-
tohwrx.RFBandwidth = round(Fpass*2);
377+
tohwrx.RFBandwidth = round(Fpass*2);

AD9361_Filter_Wizard/internal_designrxfilters9361_sinc.m

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,7 @@
6161
function result = internal_designrxfilters9361_sinc(input)
6262

6363
if ~input.wnom
64-
input.wnom = 1.4 * input.Fpass;
65-
div = ceil((input.clkPLL/input.wnom)*(log(2)/(2*pi)));
66-
caldiv = min(max(div,3),511);
67-
wc = (input.clkPLL/caldiv)*(log(2)/(2*pi));
64+
wc = (input.clkPLL/input.caldiv)*(log(2)/(2*pi));
6865
else
6966
wc = input.wnom;
7067
end

AD9361_Filter_Wizard/internal_designtxfilters9361_default.m

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
HB_interp = a.HB1*a.HB2*a.HB3;
5252
DAC_mult = a.DAC_div;
5353
PLL_mult = a.PLL_mult;
54+
caldiv = a.caldiv;
5455

5556
Fdac = Fin * FIR_interp * HB_interp;
5657
clkPLL = Fdac * DAC_mult * PLL_mult;
@@ -66,9 +67,6 @@
6667

6768
% Define the analog filters
6869
if ~wnom
69-
wnom = 1.6*Fpass;
70-
div = ceil((clkPLL/wnom)*(log(2)/(2*pi)));
71-
caldiv = min(max(div,3),511);
7270
wc = (clkPLL/caldiv)*(log(2)/(2*pi));
7371
else
7472
wc = wnom;
@@ -408,4 +406,4 @@
408406
tohwtx.CoefficientSize = length(h);
409407
tohwtx.Interp = FIR_interp;
410408
tohwtx.Gain = gain;
411-
tohwtx.RFBandwidth = round(Fpass*2);
409+
tohwtx.RFBandwidth = round(Fpass*2);

AD9361_Filter_Wizard/internal_designtxfilters9361_sinc.m

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,7 @@
6262
function result = internal_designtxfilters9361_sinc(input)
6363

6464
if ~input.wnom
65-
input.wnom = 1.6*input.Fpass;
66-
div = ceil((input.clkPLL/input.wnom)*(log(2)/(2*pi)));
67-
caldiv = min(max(div,3),511);
68-
wc = (input.clkPLL/caldiv)*(log(2)/(2*pi));
65+
wc = (input.clkPLL/input.caldiv)*(log(2)/(2*pi));
6966
else
7067
wc = input.wnom;
7168
end

0 commit comments

Comments
 (0)