Investigating FM peak deviation errors caused by SDR DSP chain - Page 1
Forum section: electronics / rf-microwave

author: radiolistener
author_rank: Super Contributor
timestamp: August 16, 2025, 02:38:51 pm
content: I’ve added real-time peak deviation measurement to SDR receiver and noticed a strange behavior. When I record the RF/IF signal directly and perform frequency translation plus a well-designed FIR LPF in Octave, I get excellent peak deviation measurements - almost 1 Hz-accurate on both test signals and real FM stations.However, when measuring deviation inside the receiver itself, the readings fluctuate significantly. I recorded the IQ signal after the SDR DSP chain before the FM demodulator and analyzed it in Octave. Indeed, the peak deviation already shows noticeable fluctuations at this stage.I suspect this might be due to poor phase characteristics of the filters used in the DSP chain before the FM demodulator.And this may explain the subtle audio distortions I occasionally hear when listening to FM broadcast stations. If the signal phase is compromised somewhere upstream of the FM demodulator, it explains the root cause.So I have a couple of questions:1) Has anyone encountered similar issues, and what are the typical causes of such distortions for FM modulated signal?2) What practical methods or test signals exist for evaluating and quantifying these kinds of distortions (in DSP chain before FM demod)?Thanks in advance for any insightsFor context, here is the Octave test code I use to measure peak deviation:Code:wfm_df = 75000; % WFM frequency deviation 75 kHzfileName = '/dev/shm/OCTAVE/test-iq-df.wav';[iq, Fs] = audioread(fileName);if size(iq,2) < 2error('Input file must be stereo (IQ stream)');endfprintf('Fs: %d Hz\n', Fs);fprintf('N: %d (%.1f sec)\n', size(iq,1), size(iq,1)/Fs);iq = iq / max(abs(iq(:))); % normalizeiq = iq(:,1) + 1j*iq(:,2); % I/Q -> complex% FM demodulation of IQ signalcomposite = angle(iq(2:end) .* conj(iq(1:end-1))); % quadrature phase difference methodcomposite = composite * Fs / (2*pi); % convert phase difference to instantaneous frequency deviation Hzfprintf('peak_deviation: %g Hz\n', max(abs(composite))); % peak frequency deviation Hzcomposite /= wfm_df; % normalize deviation to 1 (relative to modulation index)fprintf('composite_amp: %g\n', max(abs(composite))); % peak amplitude of composite (peak normalized deviation)

author: iMo
author_rank: Super Contributor
timestamp: August 17, 2025, 07:22:58 am
content: You are perhaps not using double precision math inside your SDR radio..

author: radiolistener
author_rank: Super Contributor
timestamp: August 18, 2025, 05:47:40 am
content: Yes, DSP is running on float32, but the issue with distorted deviation is reproducible in Octave when I get DSP chain output and do FM demodulation in Octave.

author: gf
author_rank: Super Contributor
timestamp: August 18, 2025, 06:02:57 am
content: A likely cause for a nonlinear phase response is IMO an IIR filter in the signal chain, either analog or digital. Is the IF bandwidth wide enough? Is the center frequency tuned correctly? If not, this would introduce a DC offset to 'composite' and a part of the occupied banwidth may fall into the transition or stop band of the IF filter.Did you already try to measure the frequency and phase response of the channel?What is the topology of the receiver? Regular (non-IQ) mixer -> regular IF amp+filter -> ADC -> DSP ?Is the DSP a "black box"?Can you post the bad .wav file? What modulating signal is it supposed to contain?

author: radiolistener
author_rank: Super Contributor
timestamp: August 20, 2025, 08:54:06 pm
content: yes, in my case the DSP is effectively a black box, I do have source code, but the internals aren’t documented and need careful auditing. At first glance I don’t see IIR stages, it’s mostly FIR and CIC. However, the coefficient design looks very questionable and the filters are looks relatively weak. I’m also worried that several decimation steps run with almost no guard band.Could that hurt FM deviation?The idea of measuring the frequency and phase response of the channel is indeed interesting, but in practice it looks challenging because input and output are difficult to synchronize. The current topology is RF I/Q => DSP black box => 240 kHz IF I/Q => FM demodulator => LPF.