diff --git a/.DS_Store b/.DS_Store deleted file mode 100644 index 25891cb..0000000 Binary files a/.DS_Store and /dev/null differ diff --git a/MainSource/main.cpp b/MainSource/main.cpp index 3e58341..2b4ad8d 100755 --- a/MainSource/main.cpp +++ b/MainSource/main.cpp @@ -39,7 +39,7 @@ static void control_cb(int control); static void control_cb2(int control); -char *ProgramVersion=(char *)"SdrGlut-1162"; +char *ProgramVersion=(char *)"SdrGlut-1164"; extern "C" struct Scene *sceneRoot(void); diff --git a/Radio/Radio.cpp b/Radio/Radio.cpp index a9ca4f8..7bea5c5 100755 --- a/Radio/Radio.cpp +++ b/Radio/Radio.cpp @@ -947,19 +947,22 @@ int Radio::updateLine() welch(real,imag,&length); amin = 0.0; + amax = 0.0; int nn=0; for(int n=10;n 0.0)v=10*log10(v)+5; double mag=(1.0-lineAlpha)*magnitude[length-n-1]+v*lineAlpha; amin += mag; + amax += v; ++nn; } amin /= nn; - + amax /= nn; + double shift=-90-amin; - rx->shiftGlobal = amin; + rx->shiftGlobal = amax; if(rx->aminGlobal3 == 0.0)rx->aminGlobal3=shift; rx->aminGlobal3 = 0.9*rx->aminGlobal3+0.1*shift; // shift=rx->aminGlobal3; @@ -1787,9 +1790,9 @@ static void displayc(void) char value[256]; if(images->rx->mute){ - msprintf(value,sizeof(value),"Frequency: %010ld Hz Center Frequency: %010ld Hz Power: %.0f db Shift: %.1f db MUTE",f,fc,images->rx->meterMax,fs); + msprintf(value,sizeof(value),"Frequency: %010ld Hz Center Frequency: %010ld Hz Power: %.0f db Avg: %.0f db MUTE",f,fc,images->rx->meterMax,fs); }else{ - msprintf(value,sizeof(value),"Frequency: %010ld Hz Center Frequency: %010ld Hz Power: %.0f db Shift: %.1f db ",f,fc,images->rx->meterMax,fs); + msprintf(value,sizeof(value),"Frequency: %010ld Hz Center Frequency: %010ld Hz Power: %.0f db Avg: %.0f db ",f,fc,images->rx->meterMax,fs); } DrawString(20, (int)scene->yResolution-15, value); diff --git a/SdrGlut.xcodeproj/project.xcworkspace/xcuserdata/dir.xcuserdatad/UserInterfaceState.xcuserstate b/SdrGlut.xcodeproj/project.xcworkspace/xcuserdata/dir.xcuserdatad/UserInterfaceState.xcuserstate index 1d42f5f..41e787b 100755 Binary files a/SdrGlut.xcodeproj/project.xcworkspace/xcuserdata/dir.xcuserdatad/UserInterfaceState.xcuserstate and b/SdrGlut.xcodeproj/project.xcworkspace/xcuserdata/dir.xcuserdatad/UserInterfaceState.xcuserstate differ