Skip to content

Commit

Permalink
Merge pull request #1230 from gqrx-sdr/fix-agc-sensitivity
Browse files Browse the repository at this point in the history
Calculate AGC parameters based on the correct sample rate
  • Loading branch information
argilo authored Apr 28, 2023
2 parents fdfb889 + 47864d4 commit 6bc4da9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
1 change: 1 addition & 0 deletions resources/news.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
FIXED: Crash when adding or removing bookmark tags.
FIXED: Redraw bookmarks immediately after changes.
FIXED: DX cluster spots fail to expire around midnight.
FIXED: AGC sensitivity bug introduced in version 2.15.10.
IMPROVED: Rendering of frequency control and S-meter on some high-DPI screens.
REMOVED: Support for GNU Radio 3.7.

Expand Down
5 changes: 2 additions & 3 deletions src/dsp/agc_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,13 +139,12 @@ void CAgc::SetParameters(bool AgcOn, bool UseHang, int Threshold, int ManualGai
m_SlopeFactor = SlopeFactor;
m_Decay = Decay;

m_DelaySamples = (int)(m_SampleRate * DELAY_TIMECONST);
m_WindowSamples = (int)(m_SampleRate * WINDOW_TIMECONST);

if (m_SampleRate != SampleRate)
{
//clear out delay buffer and init some things if sample rate changes
m_SampleRate = SampleRate;
m_DelaySamples = (int)(m_SampleRate * DELAY_TIMECONST);
m_WindowSamples = (int)(m_SampleRate * WINDOW_TIMECONST);
for (int i = 0; i < MAX_DELAY_BUF; i++)
{
m_SigDelayBuf[i] = 0.0;
Expand Down

0 comments on commit 6bc4da9

Please sign in to comment.