Skip to content

Commit

Permalink
SM5BSZ Linrad-05.03 rev 1035
Browse files Browse the repository at this point in the history
  • Loading branch information
fventuri committed May 20, 2024
1 parent 70b5f75 commit 0b1572c
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 19 deletions.
22 changes: 12 additions & 10 deletions baseb_graph.c
Original file line number Diff line number Diff line change
Expand Up @@ -1425,7 +1425,7 @@ j=bg_first_xpoint;
bg_carrfilter_points=0;
for(i=bg_first_xpixel; i<=bg_last_xpixel; i+=bg.pixels_per_point)
{
if(bg_ytmp[j] > 0.000000001)
if(bg_ytmp[j] > 1.e-7)
{
bg_carrfilter_points++;
iy=2*bg.yfac_log*log10(1./bg_ytmp[j]);
Expand Down Expand Up @@ -1692,7 +1692,6 @@ while(k <= fft3_size-j+1)
k++;
basebraw_fir_pts++;
}
basebraw_fir_pts-=2;
k=basebraw_fir_pts;
memset(&basebraw_fir[k],0,(fft3_size-k)*sizeof(float));
t1=1.e-7*basebcarr_fir[fft3_size/2];
Expand All @@ -1706,7 +1705,6 @@ while(k<fft3_size-j+1)
k++;
basebcarr_fir_pts++;
}
basebcarr_fir_pts-=2;
k=basebcarr_fir_pts;
memset(&basebcarr_fir[k],0,(fft3_size-k)*sizeof(float));
// Normalize the FIR filter so it gives the same amplitude as we have
Expand All @@ -1733,6 +1731,7 @@ for(i=0; i<basebcarr_fir_pts; i++)
}
if(fft1_correlation_flag != 0)
{

for(i=0; i<fft3_size/2; i++)
{
d_basebcarr_fir[i]*=d_fft3_window[2*i];
Expand Down Expand Up @@ -1761,13 +1760,12 @@ if(fft1_correlation_flag != 0)
k++;
d_basebcarr_fir_pts++;
}
d_basebcarr_fir_pts-=2;
k=d_basebcarr_fir_pts;
memset(&d_basebcarr_fir[k],0,(fft3_size-k)*sizeof(double));
// Normalize the FIR filter so it gives the same amplitude as we have
// with the back transformation of fft3 in mix2.
dt1=0;
for(i=0; i<basebcarr_fir_pts; i++)
for(i=0; i<d_basebcarr_fir_pts; i++)
{
dt1+=d_basebcarr_fir[i];
}
Expand Down Expand Up @@ -3485,9 +3483,9 @@ for(i=3*fft3_size/4; i<fft3_size; i++)
{
t1+=bg_binshape[i];
}
t1/=fft3_size/8;
t2=0.5*t1;
// t1 is now twice the average error.
t1/=fft3_size/4;
t2=0.1*t1;
// t1 is now the average error.
// Subtract it from our bg_binshape values.
for(i=0; i<=fft3_size/2; i++)
{
Expand All @@ -3507,16 +3505,20 @@ t2=sqrt(t2/bg_binshape[fft3_size/2]);
bg_binshape[fft3_size/2]=1;
binshape_points=0;
i=fft3_size/2-1;
// Get the -110 dB point
while(i>1 && bg_binshape[i-1] > 0.0000031)
// Get the -140 dB point
while(i>1 && bg_binshape[i-1] > 1.e-7)
{
i--;
binshape_points++;
}
if(i > 10)i-=4;
k=fft3_size-i;
while(i>0)
{
bg_binshape[i]=0;
bg_binshape[k]=0;
i--;
k++;
}
binshape_total=binshape_points;
while(i>0 && bg_binshape[i] > 1.5*t2)
Expand Down
18 changes: 9 additions & 9 deletions mix2.c
Original file line number Diff line number Diff line change
Expand Up @@ -534,17 +534,17 @@ good_poldata:;
{
for(i=0; i<sizhalf; i++)
{
d_carr[4*i ]=d_fft3[p0+4*i ]*bg_carrfilter[k+i];
d_carr[4*i+1]=d_fft3[p0+4*i+1]*bg_carrfilter[k+i];
d_carr[4*i+2]=d_fft3[p0+4*i+2]*bg_carrfilter[k+i];
d_carr[4*i+3]=d_fft3[p0+4*i+3]*bg_carrfilter[k+i];
d_carr[4*i ]=d_fft3[p0+4*i ]*d_basebcarr_fir[k+i];
d_carr[4*i+1]=d_fft3[p0+4*i+1]*d_basebcarr_fir[k+i];
d_carr[4*i+2]=d_fft3[p0+4*i+2]*d_basebcarr_fir[k+i];
d_carr[4*i+3]=d_fft3[p0+4*i+3]*d_basebcarr_fir[k+i];
}
for(i=0; i<sizhalf; i++)
{
d_carr[2*nn-4*i ]=d_fft3[p0-4*i-4]*bg_carrfilter[k-i-1];
d_carr[2*nn-4*i+1]=d_fft3[p0-4*i-3]*bg_carrfilter[k-i-1];
d_carr[2*nn-4*i+2]=d_fft3[p0-4*i-2]*bg_carrfilter[k-i-1];
d_carr[2*nn-4*i+3]=d_fft3[p0-4*i-1]*bg_carrfilter[k-i-1];
d_carr[2*nn-4*i ]=d_fft3[p0-4*i-4]*d_basebcarr_fir[k-i-1];
d_carr[2*nn-4*i+1]=d_fft3[p0-4*i-3]*d_basebcarr_fir[k-i-1];
d_carr[2*nn-4*i+2]=d_fft3[p0-4*i-2]*d_basebcarr_fir[k-i-1];
d_carr[2*nn-4*i+3]=d_fft3[p0-4*i-1]*d_basebcarr_fir[k-i-1];
}
}
else
Expand Down Expand Up @@ -916,7 +916,7 @@ if(fm_pilot_size == 0)
{
for(k=1; k<=(int)mix2.new_points; k++)
{
pa=(timf3_py+4*(1-d_basebcarr_fir_pts+fft3_size-fft3_new_points+k*resamp)+timf3_size)&timf3_mask;
pa=(timf3_py+4*(1-basebcarr_fir_pts+fft3_size-fft3_new_points+k*resamp)+timf3_size)&timf3_mask;
mm=pa;
t1=timf3_float[pa ]*basebcarr_fir[basebcarr_fir_pts/2];
t2=timf3_float[pa+1]*basebcarr_fir[basebcarr_fir_pts/2];
Expand Down
13 changes: 13 additions & 0 deletions sdrplay3.c
Original file line number Diff line number Diff line change
Expand Up @@ -1179,6 +1179,14 @@ static void sdrplay3_select_device(int *line)
goto release_sdrplay3_device;
}

err = sdrplay_api_DebugEnable(device.dev, SDRPLAY3_DEBUG);
if (err != sdrplay_api_Success) {
lir_text(3, 2, "sdrplay3: sdrplay_api_DebugEnable() failed.");
lir_text(5, 7, press_any_key);
await_keyboard();
goto release_sdrplay3_device;
}

err = sdrplay_api_GetDeviceParams(device.dev, &device_params);
if (err != sdrplay_api_Success) {
lir_text(3, 2, "sdrplay3: sdrplay_api_GetDeviceParams() failed.");
Expand Down Expand Up @@ -3410,6 +3418,11 @@ static int sdrplay3_set_device(double dt1)
goto release_sdrplay3_device;

errcod = 2625;
err = sdrplay_api_DebugEnable(device.dev, SDRPLAY3_DEBUG);
if (err != sdrplay_api_Success)
goto release_sdrplay3_device;

errcod = 2626;
err = sdrplay_api_GetDeviceParams(device.dev, &device_params);
if (err != sdrplay_api_Success)
goto release_sdrplay3_device;
Expand Down

0 comments on commit 0b1572c

Please sign in to comment.