Author Topic: WFM Stereo Broadcasting Standards - OIRT vs CCIR  (Read 17623 times)

0 Members and 1 Guest are viewing this topic.

Offline radiolistenerTopic starter

  • Super Contributor
  • ***
  • Posts: 5744
  • Country: Earth
Re: WFM Stereo Broadcasting Standards - OIRT vs CCIR
« Reply #75 on: May 20, 2026, 01:44:46 am »
After re-reading the standard more carefully (see the attached screenshot), I noticed a few details that may be relevant here.

According to sections 2.1.2.1 and 2.1.2.2, pre-emphasis is explicitly applied to both M=(L+R)/2 and S=(L-R)/2 before the subcarrier modulation stage. So I am not fully convinced that pre-emphasis can be ignored for this discussion, because it changes the spectrum of S before the shaping process takes place.

The other thing that still looks somewhat ambiguous to me is the interpretation of K(f). The standard states that the spectrum of the amplitude-modulated subcarrier shall be transformed according to K(f), but it does not explicitly describe the implementation method itself. It specifies the desired spectral result, but not exactly how to achieve it.

That leaves some room for interpretation:

- apply K(f) directly to S before modulation,
- apply shaping after AM modulation,
- or use some equivalent implementation.

These approaches may produce similar spectra while not necessarily producing identical phase behavior, which could potentially matter for the phase detector.

Regarding the strange file itself: it was generated by Stereo Tool, but the OIRT implementation there appears to have been only an early experimental attempt. The author spent quite some time trying to understand what K(f) actually means and eventually implemented it as an IIR approximation of some sort. However, I am not sure it was ever verified against the standard, and I am not even sure whether the version used to generate this file contained that implementation at all.

As far as I can tell, no further work or discussion happened afterwards, so it is entirely possible that the generated multiplex is not fully OIRT compliant.

Discussion thread about OIRT in Stereo Tool: https://forums.stereotool.com/viewtopic.php?t=6233



There may be a typo: 4.6 was likely intended to be 6.4. Would this be the correct form?
Code: [Select]
L = ...
R = ...

M = (L+R)/2;   % L+R
S = (L-R)/2;   % L-R

% ... pre-emphasis for M and for S

% K(f) shelved highpass, reduces the subcarrier and close-in sidebands
tau = 6.4 / (2*pi*1000);
[b,a] = bilinear([tau 1], [tau 5], 1/Fs);

subcf = 31250;               % subcarrier frequency 31.25 kHz

composite = 0.8*M + filter(b,a,1+0.8*S) .* cos(2*pi*subcf*t);

 

Offline radiolistenerTopic starter

  • Super Contributor
  • ***
  • Posts: 5744
  • Country: Earth
Re: WFM Stereo Broadcasting Standards - OIRT vs CCIR
« Reply #76 on: May 20, 2026, 03:57:12 am »
Regarding K(f), I have a question about its practical impact on the system behavior.

It seems that applying K(f) increases the relative level of the close-in SSB components with respect to the carrier, and this may potentially interfere with the atan2-based phase detector.

I am considering introducing an inverse K(f) filter for spectral correction, since it also affects the reconstruction of the L-R channel.

However, this raises a couple of structural questions about the processing chain:

My current pipeline is:
IF → BPF → mixdown → atan2 → NCO output
and in parallel:
IF → mixdown → DSB demod → LPF → L-R extraction

Where would the inverse K(f) be correctly applied in this structure?
Should it be applied before both branches, i.e. something like:
IF → mixdown → K⁻¹(f) → mixup → (then both PLL and L-R processing paths)?
Or is there a more correct placement?

Since K(f) has a non-trivial frequency-dependent phase response, it affects not only magnitude but also the phase structure of the L-R component.

Does this imply that the inverse filter must reproduce both magnitude and phase characteristics of K(f) very accurately in order to preserve correct stereo separation? Otherwise, could this introduce additional separation errors between channels?

Am I understanding this correctly?
« Last Edit: May 20, 2026, 04:00:03 am by radiolistener »
 

Online gf

  • Super Contributor
  • ***
  • Posts: 1832
  • Country: de
Re: WFM Stereo Broadcasting Standards - OIRT vs CCIR
« Reply #77 on: May 20, 2026, 09:23:56 am »
After re-reading the standard more carefully (see the attached screenshot), I noticed a few details that may be relevant here.

According to sections 2.1.2.1 and 2.1.2.2, pre-emphasis is explicitly applied to both M=(L+R)/2 and S=(L-R)/2 before the subcarrier modulation stage. So I am not fully convinced that pre-emphasis can be ignored for this discussion, because it changes the spectrum of S before the shaping process takes place.

I see pre-emphasis as relevant only with regard to the maximum levels of M, S and composite signal. If S becomes too strong after pre-emphasis, you would over-modulate the subcarrier. Either you ensure proper levels with a proper static gain for L and R, or with a dynamic compressor. Radio stations certainly do the latter. Otherwise, I don't see how pre-emphasis matters for the consideration.

Quote
The other thing that still looks somewhat ambiguous to me is the interpretation of K(f). The standard states that the spectrum of the amplitude-modulated subcarrier shall be transformed according to K(f), but it does not explicitly describe the implementation method itself. It specifies the desired spectral result, but not exactly how to achieve it.

That leaves some room for interpretation:

- apply K(f) directly to S before modulation,
- apply shaping after AM modulation,
- or use some equivalent implementation.

The specified transfer function is a baseband TF (before modulation). It can be realized with a simple passive voltage divider where the upper arm is R1 || C, and the lower arm is R2, where R1 = 4 * R2, and tau = R1 * C.

Any equivalent implementation is certainly allowed. But an exact post-modulation implementation using an analog shelved notch filter is actually impossible, because the symmetry of analog (or digital IIR) bandpass and notch filters is geometric rather than arithmetic. Good question how much asymmetry and thereforel AM -> PM conversion an analog 2nd order shelved notch filter would introduce.

Quote
These approaches may produce similar spectra while not necessarily producing identical phase behavior, which could potentially matter for the phase detector.

Crucial for the instantaneous phase is the conjugate complex symmetry between the upper and lower modulation sidebands, as any asymmetry introduces phase modulation in addition to AM.

Quote
There may be a typo: 4.6 was likely intended to be 6.4.

Thanks for pointing out the typo.
« Last Edit: May 20, 2026, 01:51:51 pm by gf »
 

Online gf

  • Super Contributor
  • ***
  • Posts: 1832
  • Country: de
Re: WFM Stereo Broadcasting Standards - OIRT vs CCIR
« Reply #78 on: May 20, 2026, 11:50:35 am »
Regarding K(f), I have a question about its practical impact on the system behavior.

It seems that applying K(f) increases the relative level of the close-in SSB components with respect to the carrier, and this may potentially interfere with the atan2-based phase detector.
n of the L-R channel.

However, this characteristic is precisely what enables the atan2 phase detector to operate reliably at all, without requiring an extremely narrow pre-filter.

Quote
However, this raises a couple of structural questions about the processing chain:

My current pipeline is:
IF → BPF → mixdown → atan2 → NCO output
and in parallel:
IF → mixdown → DSB demod → LPF → L-R extraction
...
Where would the inverse K(f) be correctly applied in this structure?

I would suggest the following structure:

composite(real) → M'
composite(real) → mixer(real x complex) → lowpass → [ optionally down-sample ] → atan2 → PLL loop filter → VCO(complex) → back to mixer
composite(real) → mixer(real x complex) → extract real part  →  S'

M' →              15 kHz lowpass → de-emphasis → M
S' → K-1(f) → 15 kHz lowpass → de-emphasis → S

The ordering of cascaded filters is irrelevant in linear system theory; however, structural rearrangement is often driven by practical implementation constraints. So feel free to re-arrange. Furthermore, because K(s) · K⁻¹(s) = 1, introducing a compensation delay in the M path is unnecessary, provided that K⁻¹(s) is realized as an analog or digital IIR filter.

In the flowchart above, I replaced the band-pass filter in front of the loop with a low-pass filter inside the PLL loop. For a loop bandwidth of less than 10 Hz, the loop should still remain stable despite the phase margin reduction introduced by the low-pass filter.

The optional down-sampling step reduces the computational overhead of the atan2 operation and PLL updates by eliminating the need for per-sample execution. Additionally, if the low-pass stage is a FIR filter, the computational complexity is significantly minimized when the filter calculation is combined with down-sampling. This can be implemented as a polyphase decimator, or, if the down-sampling factor equals the filter length, it even becomes a highly efficient block filter.

Particularly in the block filter configuration, the FIR approach is significantly more efficient than an IIR filter. Nevertheless, I am still investigating whether a 3rd-order critically damped IIR filter could be used for the non-down-sampled case.

Quote
Since K(f) has a non-trivial frequency-dependent phase response, it affects not only magnitude but also the phase structure of the L-R component.

Does this imply that the inverse filter must reproduce both magnitude and phase characteristics of K(f) very accurately in order to preserve correct stereo separation? Otherwise, could this introduce additional separation errors between channels?

Yes, I would say so. In the analog domain, you can undo it exactly using a simple R1, R2, C filter and a 5x gain stage. In the digital domain, you need to check how well the magnitude and phase responses of the bilinear transform of K⁻¹(s) match those of the continuous-time K⁻¹(s). Maybe K⁻¹(z) needs to be tweaked a bit. [ Well, I said 'exact,' but in reality, analog also suffer from component tolerances. ]



EDIT:

Quote
Nevertheless, I am still investigating whether a 3rd-order critically damped IIR filter could be used for the non-down-sampled case.

The following IIR filter also seems to work ffine for me.
Tau is the same as for K(f). We need 3rd order, in order to get > 100 dB for 15kHz mono components.

Code: [Select]
% phase detector pre-filter
[b3,a3] = bilinear(1, [tau^3, 3*(tau^2), 3*tau, 1], 1/Fs);
« Last Edit: May 20, 2026, 02:39:25 pm by gf »
 
The following users thanked this post: radiolistener

Offline radiolistenerTopic starter

  • Super Contributor
  • ***
  • Posts: 5744
  • Country: Earth
Re: WFM Stereo Broadcasting Standards - OIRT vs CCIR
« Reply #79 on: May 20, 2026, 02:02:47 pm »
I would suggest the following structure:

composite(real) → M'
composite(real) → mixer(real x complex) → lowpass → [ optionally down-sample ] → atan2 → PLL loop filter → VCO(complex) → back to mixer
composite(real) → mixer(real x complex) → extract real part  →  S'

M' →              15 kHz lowpass → de-emphasis → M
S' → K-1(f) → 15 kHz lowpass → de-emphasis → S

The ordering of cascaded filters is irrelevant in linear system theory; however, structural rearrangement is often driven by practical implementation constraints. So feel free to re-arrange. Furthermore, because K(s) · K⁻¹(s) = 1, introducing a compensation delay in the M path is unnecessary, provided that K⁻¹(s) is realized as an analog or digital IIR filter.

In the flowchart above, I replaced the band-pass filter in front of the loop with a low-pass filter inside the PLL loop. For a loop bandwidth of less than 10 Hz, the loop should still remain stable despite the phase margin reduction introduced by the low-pass filter.

One point still confuses me a bit.

In your proposed structure, K⁻¹(f) is applied only in the S' path for L-R reconstruction, while the PLL path still operates on the original K(f)-shaped signal:

composite → mixdown → LPF → atan2 → PLL

Wouldn't this leave the PLL phase detector exposed to the same altered carrier/sideband ratio introduced by K(f)?

My concern is that without K⁻¹(f) before the PLL path, the close-in sidebands around the subcarrier would still remain relatively elevated with respect to the carrier. In that case it seems that the PLL branch would still require a very narrow LPF, about ~100-300 Hz, in order to suppress their influence on the atan2 detector.

At Fs= ~192 kS/s such a filter can become rather expensive computationally.

Do you think K⁻¹(f) is intentionally unnecessary for the PLL path, or am I missing some mechanism that already makes the LPF inside the loop sufficient?
 

Online gf

  • Super Contributor
  • ***
  • Posts: 1832
  • Country: de
Re: WFM Stereo Broadcasting Standards - OIRT vs CCIR
« Reply #80 on: May 20, 2026, 02:55:55 pm »
In your proposed structure, K⁻¹(f) is applied only in the S' path for L-R reconstruction, while the PLL path still operates on the original K(f)-shaped signal:

composite → mixdown → LPF → atan2 → PLL

Wouldn't this leave the PLL phase detector exposed to the same altered carrier/sideband ratio introduced by K(f)?

My concern is that without K⁻¹(f) before the PLL path, the close-in sidebands around the subcarrier would still remain relatively elevated with respect to the carrier. In that case it seems that the PLL branch would still require a very narrow LPF, about ~100-300 Hz, in order to suppress their influence on the atan2 detector.

Do you think K⁻¹(f) is intentionally unnecessary for the PLL path, or am I missing some mechanism that already makes the LPF inside the loop sufficient?

The LPF is designed to overcompensate the K(f) shape. Design goals are:

1.Overcompensation of K(f) at any frequency (in order to obtain a signal that does no longer suffer from over-modulation artifacts)
2. Sufficient attenuation for 15 kHz mono components (say -100 dB)

Quote
At Fs= ~192 kS/s such a filter can become rather expensive computationally.

Which one do you mean? K-1(z) is a first-oder IIR filter. And LPF can be either a 3rd-order IIR filter, or a FIR block filter (if decimation is used) which is even cheaper than the IIR (only one complex add per sample).



EDIT: See attached plot. With "overcompensated" I mean that the orange curve is completely below the blue one, for any f > 0.
K-1(f) compensates exactly, by reducing far-out sidebands (relative to the subcarrier). And LPF reduces them even more.
[ If LPF had a flat-top shape, then the orange curve could be above the blue one, at low frequencies, before rolling-off steeply. And that's not what we want. ]
« Last Edit: May 20, 2026, 03:34:28 pm by gf »
 
The following users thanked this post: radiolistener

Offline radiolistenerTopic starter

  • Super Contributor
  • ***
  • Posts: 5744
  • Country: Earth
Re: WFM Stereo Broadcasting Standards - OIRT vs CCIR
« Reply #81 on: May 20, 2026, 03:35:46 pm »
Thanks, I think I now understand your idea more clearly.

So the LPF after the mixer is not just a simple anti-alias / noise filter, but is actually designed as a combined preconditioning stage that takes the K(f) shaping into account, effectively compensating it in the phase detector path while also ensuring the atan2 input never enters an over-modulation regime.

In other words, the LPF becomes part of the phase detector dynamics (since it follows the VCO-controlled mixer), effectively replacing the need for an explicit K⁻¹(f) stage.

If I understand correctly, this means the loop is intentionally designed so that the LPF effectively counteracts the K(f) shaping in terms of amplitude response, while still preserving sufficient phase information for locking. This leads to a very elegant simplification of the overall demodulation chain, since the K(f) compensation and PLL conditioning are merged into a single stage instead of being handled separately.

One question I still have: since this LPF becomes part of the phase detector transfer function inside the loop, wouldn’t its additional group delay and frequency-dependent phase shift directly affect loop stability and phase margin, especially for very low loop bandwidths (~5–10 Hz)?
« Last Edit: May 20, 2026, 03:41:45 pm by radiolistener »
 

Online gf

  • Super Contributor
  • ***
  • Posts: 1832
  • Country: de
Re: WFM Stereo Broadcasting Standards - OIRT vs CCIR
« Reply #82 on: May 20, 2026, 03:46:43 pm »
Thanks, I think I now understand your idea more clearly.

So the LPF after the mixer is not just a simple anti-alias / noise filter, but is actually designed as a combined preconditioning stage that takes the K(f) shaping into account, effectively compensating it in the phase detector path while also ensuring the atan2 input never enters an over-modulation regime.

In other words, the LPF is part of the phase detector dynamics (since it follows the VCO-controlled mixer), so it effectively replaces the need for an explicit K⁻¹(f) stage.

If I understand correctly, this means the loop is intentionally designed so that the LPF dominates the K(f) shaping in terms of amplitude response, while still preserving sufficient phase information for locking.

One question I still have: since this LPF becomes part of the phase detector transfer function inside the loop, wouldn’t its additional group delay and frequency-dependent phase shift directly affect loop stability and phase margin, especially for very low loop bandwidths (~5–10 Hz)?

An additional aim of LPF is the elimination of mono components and negative frequencies in the (down-mixed) composite signal. The input to the phase detector must be strictly limited to the modulated subcarrier. Symmetrical side bands don't matter (as long as they are no over-modulated). As I said, with a loop BW < 10 Hz, the loop's phase margin is stlll acceptable. LPF bandwidth is still much wider than the loop BW. Yet another advantage of the LPF inside the loop is that the VCO will directly track the subcarrier phase, w/o phase delay.
« Last Edit: May 20, 2026, 03:50:29 pm by gf »
 

Online gf

  • Super Contributor
  • ***
  • Posts: 1832
  • Country: de
Re: WFM Stereo Broadcasting Standards - OIRT vs CCIR
« Reply #83 on: May 20, 2026, 04:04:43 pm »
This leads to a very elegant simplification of the overall demodulation chain, since the K(f) compensation and PLL conditioning are merged into a single stage instead of being handled separately.

Only for the PLL. You still need to apply K-1(f) to the demoduated S'.
 

Offline radiolistenerTopic starter

  • Super Contributor
  • ***
  • Posts: 5744
  • Country: Earth
Re: WFM Stereo Broadcasting Standards - OIRT vs CCIR
« Reply #84 on: May 20, 2026, 04:12:51 pm »
[ If LPF had a flat-top shape, then the orange curve could be above the blue one, at low frequencies, before rolling-off steeply. And that's not what we want. ]

Thanks, I think I now understand the issue you are pointing out regarding the LPF shape.

I am currently using a classic windowed Kaiser FIR design for the LPF, but I now see that this approach is essentially "flat-top in behavior" with respect to the K(f) constraint, and therefore not optimal for ensuring the required overcompensation condition.

It makes sense that the filter should not just approximate an ideal low-pass response, but instead be shaped such that it always stays below the inverse K(f) envelope, rather than crossing it at any frequency.

What kind of LPF structure would you recommend in this case?

Would you consider a low-order IIR with explicitly placed poles/zeros, or perhaps a frequency-weighted FIR design to better match this constraint?
 

Online gf

  • Super Contributor
  • ***
  • Posts: 1832
  • Country: de
Re: WFM Stereo Broadcasting Standards - OIRT vs CCIR
« Reply #85 on: May 20, 2026, 04:18:29 pm »
[ If LPF had a flat-top shape, then the orange curve could be above the blue one, at low frequencies, before rolling-off steeply. And that's not what we want. ]

Thanks, I think I now understand the issue you are pointing out regarding the LPF shape.

I am currently using a classic windowed Kaiser FIR design for the LPF, but I now see that this approach is essentially "flat-top in behavior" with respect to the K(f) constraint, and therefore not optimal for ensuring the required overcompensation condition.

It makes sense that the filter should not just approximate an ideal low-pass response, but instead be shaped such that it always stays below the inverse K(f) envelope, rather than crossing it at any frequency.

What kind of LPF structure would you recommend in this case?

Would you consider a low-order IIR with explicitly placed poles/zeros, or perhaps a frequency-weighted FIR design to better match this constraint?

I already added to a previous message:

Code: [Select]
% phase detector pre-filter
[b3,a3] = bilinear(1, [tau^3, 3*(tau^2), 3*tau, 1], 1/Fs);

Same tau as K(f).

Or a Hann window as FIR filter (in conjunction with down-sampling).
 
The following users thanked this post: radiolistener

Offline radiolistenerTopic starter

  • Super Contributor
  • ***
  • Posts: 5744
  • Country: Earth
Re: WFM Stereo Broadcasting Standards - OIRT vs CCIR
« Reply #86 on: May 20, 2026, 04:42:43 pm »
Thanks, this clarifies the idea of using a tau-matched 3rd-order critically damped IIR as a phase detector prefilter.

One question I still have about this approach - how do you evaluate the PLL stability margin in this configuration in practice?

Since the LPF is effectively part of the phase detector transfer function (and also interacts with K(f)-shaping), the open-loop behavior seems to differ significantly from a classical PLL model.

Also, do you take the additional group delay of the 3rd-order filter into account explicitly when tuning the loop bandwidth?
 

Online gf

  • Super Contributor
  • ***
  • Posts: 1832
  • Country: de
Re: WFM Stereo Broadcasting Standards - OIRT vs CCIR
« Reply #87 on: May 20, 2026, 08:47:37 pm »
Also, do you take the additional group delay of the 3rd-order filter into account explicitly when tuning the loop bandwidth?

At 4.85 Hz gain-crossover frequency (10 Hz loop BW), we talk about ~3ms, or ~5° margin reduction. Don't worry ;)
My experimental PLL locks nicely at 25 Hz offset.
 
The following users thanked this post: radiolistener

Offline radiolistenerTopic starter

  • Super Contributor
  • ***
  • Posts: 5744
  • Country: Earth
Re: WFM Stereo Broadcasting Standards - OIRT vs CCIR
« Reply #88 on: May 21, 2026, 12:37:57 am »
Thanks, this clarifies it.

I have another question regarding the phase detector pre-filter concept, but now for CCIR stereo.

Unlike OIRT, CCIR has no K(f) shaping, and there is also a guard region around the 19 kHz pilot, so under ideal conditions there should not be strong close-in sidebands around the carrier itself.

However, in a practical implementation the pilot path is still not perfectly isolated. In my current implementation I use a BPF (and I am considering replacing it with an LPF approach similar to your suggestion). To save computation cost I am not using extremely high attenuation, so some residual high-frequency components from M or S may still leak through, together with noise and other nearby spectral components.

Would a phase detector pre-filter still be beneficial in that case as a way to improve atan2 robustness, or is it mainly useful because of the K(f) shaping in OIRT?

And if it is still beneficial for CCIR, how would you choose its time constant?


Also, I tried adding K(f) shaping to my OIRT test signal and implemented K^-1(f) de-shaping in my OIRT stereo demodulator. Surprisingly, everything works quite well even with my previous PLL implementation: the loop does not lose lock and the lock metric remains stable.

On a test OIRT composite recording with speech the result became noticeably better: bass content reappeared, the stereo effect became stronger, and the sound subjectively became softer and more spacious.

On music recordings, however, some frequency distortions still remain. This may simply be distortion already present in the original recording, although at the moment I cannot completely exclude the possibility that some of it may also come from small PLL jitter caused by strong sideband energy entering the phase detector path.

I will try the new PLL approach and compare the results.


Attached the new synthetic test composite signal with OIRT Polar stereo that now includes K(f) shaping, generated in Octave.

At the moment I am still not completely sure that my implementation is fully correct. The subcarrier level looks reasonably close to the reference OIRT off-air recordings (around -20 dBFS), so that part seems plausible. Although the subcarrier appears to be roughly 6 dB stronger in my file, there is no reliable absolute level reference available because the original WFM signal was not captured for those off-air recordings. The reference recordings were taken directly from the FM discriminator output, therefore only relative amplitude comparisons can be made.

What still puzzles me is that the audio component itself ends up at a rather low level, which is also visible directly in the composite waveform. In real off-air recordings the composite signal appears significantly stronger.

My current suspicion is that perhaps M=(L+R) and S=(L−R) should not actually be divided by 2 in practice. However, the standard explicitly defines them that way, so at the moment I feel I may still be missing something.
« Last Edit: May 21, 2026, 12:40:17 am by radiolistener »
 

Online gf

  • Super Contributor
  • ***
  • Posts: 1832
  • Country: de
Re: WFM Stereo Broadcasting Standards - OIRT vs CCIR
« Reply #89 on: May 21, 2026, 02:33:23 pm »
I have another question regarding the phase detector pre-filter concept, but now for CCIR stereo.

Unlike OIRT, CCIR has no K(f) shaping, and there is also a guard region around the 19 kHz pilot, so under ideal conditions there should not be strong close-in sidebands around the carrier itself.

An atan phase detector cannot deal with out-of-band interfering signals.
So you must ensure sufficient attenuation at f <= 15 kHz and f >= 23 kHz (i.e. outside the guard interval).
For a -100 dB aim, you could try a 3rd order Chebychev2:

Code: [Select]
[b, a] = cheby2(3, 100, 4000/Fs*2);
Max. group delay is ~1.6 ms, so even shorter than the 3 ms of the 3rd-order critically damped one with tau ~ 1 ms.
[ Btw, the flat top does not matter here -- no need to be strictly below K-1(f). ]

Quote
Also, I tried adding K(f) shaping to my OIRT test signal and implemented K^-1(f) de-shaping in my OIRT stereo demodulator. Surprisingly, everything works quite well even with my previous PLL implementation: the loop does not lose lock and the lock metric remains stable.

If the PLL did work without K(f) shaping at the transmitter side, then it will certainly continue to work with transmitter side K(f) shaping. The problem is rather that the receiver side PLL could fail without transmitter side K(f) shaping if the L-R signal happens to be strong and contains very low frequencies (say, a 30 Hz tone at 100% level).

Quote
Attached the new synthetic test composite signal with OIRT Polar stereo that now includes K(f) shaping, generated in Octave.

At the moment I am still not completely sure that my implementation is fully correct. The subcarrier level looks reasonably close to the reference OIRT off-air recordings (around -20 dBFS), so that part seems plausible. Although the subcarrier appears to be roughly 6 dB stronger in my file, there is no reliable absolute level reference available because the original WFM signal was not captured for those off-air recordings. The reference recordings were taken directly from the FM discriminator output, therefore only relative amplitude comparisons can be made.

What still puzzles me is that the audio component itself ends up at a rather low level, which is also visible directly in the composite waveform. In real off-air recordings the composite signal appears significantly stronger.

Your composite signal utilizes the [-1, 1] range fully, and sub-carrier level is fine, too. Maybe there are just a few loud peaks and mostly low-volume passages? It also looks like the signal is rather "narrow" (at least on average). Radio stations use dynamic compressors to adjust volume dynamically.

Quote
My current suspicion is that perhaps M=(L+R) and S=(L−R) should not actually be divided by 2 in practice. However, the standard explicitly defines them that way, so at the moment I feel I may still be missing something.

If L and R are arbitrary signals with values bounded within the [-1, 1] range (after applying pre-emphasis), then (L+R)/2 and (L-R)/2 and the 0.8 scaling factor make perfectly sense, because they guarantee that the resulting composite signal is strictly bounded within within the [-1, 1] range as well.
« Last Edit: May 21, 2026, 06:00:39 pm by gf »
 

Online gf

  • Super Contributor
  • ***
  • Posts: 1832
  • Country: de
Re: WFM Stereo Broadcasting Standards - OIRT vs CCIR
« Reply #90 on: May 21, 2026, 03:38:04 pm »
For a -100 dB aim, you could try a 3rd order Chebychev2:

Code: [Select]
[b, a] = cheby2(3, 100, 4000/Fs*2);
Max. group delay is ~1.6 ms, so even shorter than the 3 ms of the 3rd-order critically damped one with tau = 1 ms.
[ Btw, the flat top does not matter here -- no need to be strictly below K-1(f). ]

Or, if you want a FIR filter:

Code: [Select]
b = kaiser(round(0.0010677*Fs), 13); b /= sum(b); a = 1;
Group delay is even lower => 0.54 ms.
« Last Edit: May 21, 2026, 04:27:46 pm by gf »
 

Offline radiolistenerTopic starter

  • Super Contributor
  • ***
  • Posts: 5744
  • Country: Earth
Re: WFM Stereo Broadcasting Standards - OIRT vs CCIR
« Reply #91 on: May 21, 2026, 04:03:22 pm »
I think I may have found the reason why the reference off-air recording sounds louder than my synthetic test signal.

The spectrum clearly shows that the off-air recording has a sharp audio cutoff around 10 kHz, while my synthetic test utilize the full 15 kHz audio bandwidth.

Considering the effect of pre-emphasis, limiting the audio bandwidth to 10 kHz allows a noticeably higher input audio level without overdriving the FM modulator. The reason is the rapid increase of composite signal amplitude as the audio content approaches the upper end of the baseband spectrum.

For example, with the pre-emphasis filter, the gain at 10 kHz is approximately 10.362 dB, while at 15 kHz it reaches about 13.656 dB. Therefore, restricting the audio bandwidth to 10 kHz would theoretically allow the input signal level to be increased by about:

13.656 - 10.362 = 3.294 dB

while maintaining the same peak modulation limits.


The attached screenshots illustrate this quite clearly. In the first spectrum view, the audio cutoff can be seen clearly from the sharp boundary of the M component in the real off-air station recording.

The second screenshot also shows how the high-frequency portion of a test sweep (0 - 15 kHz) effectively limits the allowable input signal amplitude. As the sweep approaches the upper end of the audio band, the pre-emphasis increasingly boosts those components, causing them to dominate the composite peak level.
 
The following users thanked this post: gf

Online gf

  • Super Contributor
  • ***
  • Posts: 1832
  • Country: de
Re: WFM Stereo Broadcasting Standards - OIRT vs CCIR
« Reply #92 on: May 21, 2026, 04:19:39 pm »
I think I may have found the reason why the reference off-air recording sounds louder than my synthetic test signal.

The spectrum clearly shows that the off-air recording has a sharp audio cutoff around 10 kHz, while my synthetic test utilize the full 15 kHz audio bandwidth.

Considering the effect of pre-emphasis, limiting the audio bandwidth to 10 kHz allows a noticeably higher input audio level without overdriving the FM modulator. The reason is the rapid increase of composite signal amplitude as the audio content approaches the upper end of the baseband spectrum.

For example, with the pre-emphasis filter, the gain at 10 kHz is approximately 10.362 dB, while at 15 kHz it reaches about 13.656 dB. Therefore, restricting the audio bandwidth to 10 kHz would theoretically allow the input signal level to be increased by about:

13.656 - 10.362 = 3.294 dB

while maintaining the same peak modulation limits.

Sure, if you statically scale for the worst case pre-emphasis (15 kHz tone with 100% level), then it will become rather quiet on average.
Multiband compressors/limiters even shape the spectrum dynamically on demand.
« Last Edit: May 21, 2026, 05:42:59 pm by gf »
 

Online gf

  • Super Contributor
  • ***
  • Posts: 1832
  • Country: de
Re: WFM Stereo Broadcasting Standards - OIRT vs CCIR
« Reply #93 on: May 21, 2026, 09:40:08 pm »
I have revised the 3rd-order IIR pre-filter for the OIR PLL phase detector.
The limiting value for tau3 occurs where the normalized magnitudes |K⁻¹(f)| and |H_LPF(f)| have identical curvature at the peak.
This threshold is tau3 >= sqrt(0.32) * tau, rather than the baseline tau from K(f). [ Thanks to Google for the help with the calculation. ]
Furthermore, attenuation at 16250 Hz is over 106 dB, meaning this condition is also fulfilled.
Max. group delay is only 0.86 ms.

Code: [Select]
tau3 = sqrt(0.32) * tau;
[b3,a3] = bilinear(1, [tau3^3, 3*(tau3^2), 3*tau3, 1], 1/Fs);
 
The following users thanked this post: radiolistener

Offline radiolistenerTopic starter

  • Super Contributor
  • ***
  • Posts: 5744
  • Country: Earth
Re: WFM Stereo Broadcasting Standards - OIRT vs CCIR
« Reply #94 on: May 28, 2026, 09:09:27 pm »
I am still fighting with signal level recovery in my FM stereo multiplex decoder for both CCIR and OIRT standards, and I currently have two related issues.

1) OIRT carrier-dependent gain normalization

In OIRT stereo there is an inherent dependency on the 31.25 kHz subcarrier amplitude, because after synchronous AM demodulation of the S signal (L-R component) I need to remove the residual DC component caused by the transmitted carrier.

After thinking about the problem, I came up with the idea of normalizing both M and S channels using the recovered subcarrier level. This allows me to normalize the gain of both components first, and then simply subtract 1.0 as the DC bias from the AM-demodulated S signal.

My reasoning comes from the OIRT modulation formula itself:
Code: [Select]
composite = 0.8*M + filter(b,a,1+0.8*S) .* real(lo)
where a and b are the K(f) filter coefficients.

If you look carefully at the structure of this equation, it implicitly assumes that after applying the inverse K^-1(f) filter on the receiver side, the recovered carrier amplitude should become exactly 1.0, matching the absolute carrier level originally used at the transmitter. From that perspective, using the recovered subcarrier amplitude as a normalization reference for both M and S initially seemed quite reasonable to me.

Here is my current code for OIRT decoder:
Code: [Select]
            // <...> M = composite sample

            // synchronous AM demod S = 2 * real(composite .* conj(lo));
            S = 2.0f * M * lo.real();

            // inverse K(f)
            iirfilt_rrrf_execute(s->inv_kf, S, &S);
           
            // normalize M and S gain by sub-carrier
            iirfilt_rrrf_execute(s->lpf_dcS, S-1.0, &G);
            G = G + 1.0f;    // estimated gain
            if (G >= 0.5f && G < 1.5f) {
                M = M / G;
                S = S / G;
                // remove bias DC
                S = S - 1.0f;
            } else {
                S = 0.0f;
            }

Here M is the composite signal input. After this stage both M and S are passed through a 15 kHz LPF, then L/R are reconstructed through the stereo matrix, followed by IIR de-emphasis.

At first glance this approach works reasonably well and, importantly, produces noticeably fewer LF transients compared to independently removing DC from the M and S paths.

The only issue is that on real broadcasts the estimated gain G still slightly fluctuating even with a 0.5 Hz cutoff in lpf_dcS. I suspect this happens because I currently use a simple 1st-order LPF with a very gentle roll-off.

One idea is to estimate the carrier level directly inside the PLL instead of after the K^-1(f) equalization filter. However, in that case the recovered carrier amplitude would still include the original K(f) shaping, so I would need to hardcode a compensation factor corresponding to K^-1(0) = +13.979 dB at DC.

I am not sure which approach is considered more correct:
- estimate carrier amplitude directly in the PLL without K^-1(f), which is computationally preferable,
- or estimate it after the inverse K(f) filtering during S recovery.

I also have some doubts whether normalizing both M and S by the recovered subcarrier level is theoretically correct in the first place.

A similar approach could also be applied to CCIR stereo by normalizing M and S using the 19 kHz pilot level. In CCIR this is mostly a gain calibration issue rather than a decoding issue, because DSB-SC has no transmitted carrier and therefore does not require DC removal after demodulation.

My main concern with this approach is that a stereo decoder is expected to continue operating correctly even when the OIRT carrier or CCIR pilot is absent, falling back gracefully to mono operation. With my current normalization scheme, however, the AGC relies entirely on the recovered carrier/pilot amplitude, so in the absence of the subcarrier reference there is nothing left to anchor the gain normalization.

This also implies that if the carrier or pilot disappears, the audio level may change abruptly because the gain normalization mechanism would no longer have a valid reference and would effectively stop operating.

This raises the question of whether normalizing the M and S paths using the recovered carrier/pilot level is actually a good design choice in the first place. If such normalization should be avoided, then what would be the preferred or more correct method of removing the carrier-induced DC bias from the OIRT S channel after demodulation?


2) Correct output gain after de-emphasis

This problem affects both CCIR and OIRT decoders.

The decoder output gain must compensate for the attenuation introduced by the de-emphasis filter. With standard tau=50us, the recovered audio after de-emphasis ends up attenuated by approximately -13.656 dB. This occurs because the FM deviation limit prevents the signal level at the FM modulator input from exceeding unity amplitude. As a result, the transmitter is forced to attenuate the L and R levels to compensate for the gain introduced by the pre-emphasis filter.

However, in practice this attenuation appears to depend on the station. For example, if a station limits its audio bandwidth to around 10 kHz, the effective attenuation after pre-emphasis can be about 4 dB smaller.

As a result, if the receiver blindly applies a fixed +13.656 dB compensation gain, audio from such a 10 kHz-limited station can clip by roughly 4 dB.

So my question is: what is the correct/common way to handle this in a proper FM stereo decoder?

Of course the user can manually adjust gain per station, but that feels like a workaround. Ideally the receiver should recover correct audio levels automatically using only FM deviation and the de-emphasis time constant. How is this normally solved in professional or broadcast-grade receivers?
« Last Edit: May 28, 2026, 09:24:56 pm by radiolistener »
 

Online gf

  • Super Contributor
  • ***
  • Posts: 1832
  • Country: de
Re: WFM Stereo Broadcasting Standards - OIRT vs CCIR
« Reply #95 on: May 29, 2026, 10:00:18 am »
Thanks to the guard bands, the CCIR pilot can be easily isolated, allowing its amplitude to be extracted as an amplitude reference.
In contrast, the OIRT subcarrier cannot be separated from low-frequency sidebands (bass tones) as easily.
If the lpf_dcS filter is not narrow enough, the residual bass tones will unavoidably modulate the AGC gain G(t).

Quote
However, in practice this attenuation appears to depend on the station. For example, if a station limits its audio bandwidth to around 10 kHz, the effective attenuation after pre-emphasis can be about 4 dB smaller.

It depends not only on the station but also on the program material itself, meaning a fixed bandwidth limit cannot be expected. Stations heavily utilize dynamic limiters and compressors, often relying on dedicated radio audio processors (Orban Optimod and Telos Omnia seem to be the two market leaders). Their aim is not necessarily an exact mathematical reproduction but rather a subjective, "good-sounding" result, while strictly preventing over-modulation. Ultimately, it is as much an art as it is a science. To deliver a highly dense and loud audio signal that never sounds distorted or harsh to the human ear, these processors rely on a sophisticated combination of psychoacoustic modeling, complex multi-band compressors, and intelligent clippers. While these processors heavily automate the optimization process, they remain highly adjustable, allowing station engineers to sculpt their signature sound.
« Last Edit: May 29, 2026, 10:05:32 am by gf »
 

Offline radiolistenerTopic starter

  • Super Contributor
  • ***
  • Posts: 5744
  • Country: Earth
Re: WFM Stereo Broadcasting Standards - OIRT vs CCIR
« Reply #96 on: May 29, 2026, 02:20:03 pm »
Interestingly, despite the theoretical concerns, the AGC-based approach actually gives noticeably cleaner results on real off-air recordings compared to using separate HPF stages for DC removal in the M and S paths. In particular, it seems to produce significantly fewer LF artifacts and transients.

What still bothers me, however, is how such a scheme should properly handle carrier loss. If the OIRT carrier disappears or becomes unreliable, I would like to avoid audible clicks, sudden gain jumps, or abrupt loudness changes caused by the normalization loop losing its reference.

And what is really frustrating me at the moment is that I still have to adjust the decoder output gain manually, because in practice it appears to depend not only on FM deviation and the de-emphasis time constant, but also quite strongly on the station’s audio bandwidth and processing chain.

As a result, different stations end up requiring different compensation gains, which makes manual per-station adjustment rather inconvenient. At this point I am not even sure what the correct approach should be here, since ideally the decoder should recover proper audio levels automatically without requiring user tuning.
 

Offline radiolistenerTopic starter

  • Super Contributor
  • ***
  • Posts: 5744
  • Country: Earth
Re: WFM Stereo Broadcasting Standards - OIRT vs CCIR
« Reply #97 on: May 29, 2026, 03:05:52 pm »
It depends not only on the station but also on the program material itself, meaning a fixed bandwidth limit cannot be expected. Stations heavily utilize dynamic limiters and compressors, often relying on dedicated radio audio processors (Orban Optimod and Telos Omnia seem to be the two market leaders). Their aim is not necessarily an exact mathematical reproduction but rather a subjective, "good-sounding" result, while strictly preventing over-modulation. Ultimately, it is as much an art as it is a science. To deliver a highly dense and loud audio signal that never sounds distorted or harsh to the human ear, these processors rely on a sophisticated combination of psychoacoustic modeling, complex multi-band compressors, and intelligent clippers. While these processors heavily automate the optimization process, they remain highly adjustable, allowing station engineers to sculpt their signature sound.

That actually explains a lot and matches what I am observing experimentally. I initially assumed that after compensating for de-emphasis attenuation there should exist some more or less deterministic output gain derived from deviation and the tau constant alone. But in practice modern broadcast chains clearly violate that assumption.

If stations are using aggressive multiband processing, psychoacoustic loudness optimization, adaptive clipping, and dynamically varying bandwidth limits, then the effective gain after pre-emphasis is no longer fixed.

So now I am wondering what would be the best practical approach for a decoder implementation. Would it make more sense to expose the gain correction purely as a manual user option, while by default leaving the signal attenuated after de-emphasis with no compensation at all? Or is it still preferable to apply some automatic correction gain by default — and if so, what would be the most reasonable reference point for choosing it?
 

Online gf

  • Super Contributor
  • ***
  • Posts: 1832
  • Country: de
Re: WFM Stereo Broadcasting Standards - OIRT vs CCIR
« Reply #98 on: May 30, 2026, 09:26:35 am »
Different audio materials have distinct crest factors, and human perception of loudness is a matter of acoustic power, and also frequency-dependent. Scaling different audio sources to the same peak voltage does not result in equal perceived loudness. To implement a perceptual audio AGC, you should instead normalize the K-weighted average power rather than the voltage. [ Or the K-weighted average power sum, for multi-channel audio. ]

Seems there also exists an ITU Recommendation
Algorithms to measure audio programme loudness and true-peak audio level

While radio processors/compressors can (and certainly do) reduce the crest factor, full equalization would likely compromise perceived sound quality too much. Given the strict constraint of maximum FM deviation (which bounds the composite signal's peak level) it is IMO practically impossible to transmit different audio sources such that a perfectly uniform perceived loudness is achieved after demodulation.

I don't think that classical analog broadcast receivers implemented audio AGC, let alone a perceptual one. Their AGC was limited to the RF/IF stages to stabilize signal reception. On the other hand, in an SDR, implementing this feature has a low cost-overhead, as it is handled entirely in software.

EDIT: However, it should be noted that real-time audio AGC unavoidably introduces additional dynamic range compression, even if it operates with a longer time constant than typical compressors. If a station intentionally reduces compression to retain a higher dynamic range (e.g. for classical music), a receiver-side AGC would compromise that effort.
« Last Edit: May 30, 2026, 09:56:35 am by gf »
 

Online gf

  • Super Contributor
  • ***
  • Posts: 1832
  • Country: de
Re: WFM Stereo Broadcasting Standards - OIRT vs CCIR
« Reply #99 on: May 30, 2026, 04:02:06 pm »
Interestingly, despite the theoretical concerns, the AGC-based approach actually gives noticeably cleaner results on real off-air recordings compared to using separate HPF stages for DC removal in the M and S paths. In particular, it seems to produce significantly fewer LF artifacts and transients.

The question is, what's the actual defect of the composite signal? Do you refer to the two records you uploded to a file share?
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf

 

-->