[FFmpeg-cvslog] [ffmpeg-radio] branch master updated: avradio/sdrdemux: Some corrections to the FM stereo side channel
Michael Niedermayer
ffmpeg-git at ffmpeg.org
Sat Jul 15 21:31:39 EEST 2023
This is an automated email from the git hooks/post-receive script.
Git pushed a commit to branch master
in repository libavradio.
The following commit(s) were added to refs/heads/master by this push:
new b6fc0c3a7a avradio/sdrdemux: Some corrections to the FM stereo side channel
b6fc0c3a7a is described below
commit b6fc0c3a7a6bfec2939386c83886bf9a3b920e1f
Author: Michael Niedermayer <michael at niedermayer.cc>
AuthorDate: Thu Jul 13 23:02:02 2023 +0200
avradio/sdrdemux: Some corrections to the FM stereo side channel
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
---
libavradio/sdrdemux.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/libavradio/sdrdemux.c b/libavradio/sdrdemux.c
index 041775730e..5a6a9b8894 100644
--- a/libavradio/sdrdemux.c
+++ b/libavradio/sdrdemux.c
@@ -656,7 +656,7 @@ static av_always_inline void synchronous_am_demodulationN(AVComplexFloat *iblock
for (int i = 0; i<len; i++) {
AVComplexFloat c = icarrier[i];
AVComplexFloat s = iblock[i];
- float w = window[i];
+ float w = N == 2 ? 1.0 : window[i];
AVComplexFloat c2= {c.re*c.re, c.im*c.im};
float den = w/(c2.re + c2.im);
@@ -1080,8 +1080,9 @@ static int demodulate_fm(SDRContext *sdr, Station *station, AVStream *st, AVPack
newbuf[2*i+0] = (sdr->fm_iblock[i + sdr->fm_block_size_p2].re) * sdr->fm_window_p2[i + sdr->fm_block_size_p2] * scale;
if (carrier19_i >= 0) {
- q = sst->out_buf[2*i+1] + sdr->fm_iside[i ].im * sdr->fm_window_p2[i ] * scale;
- newbuf[2*i+1] = sdr->fm_iside[i + sdr->fm_block_size_p2].im * sdr->fm_window_p2[i + sdr->fm_block_size_p2] * scale;
+ //the 0.5 is because we have both sides of the spectrum for iside
+ q = sst->out_buf[2*i+1] + sdr->fm_iside[i ].im * sdr->fm_window_p2[i ] * (scale * 0.5);
+ newbuf[2*i+1] = sdr->fm_iside[i + sdr->fm_block_size_p2].im * sdr->fm_window_p2[i + sdr->fm_block_size_p2] * (scale * 0.5);
sst->out_buf[2*i+0] = m + q;
sst->out_buf[2*i+1] = m - q;
More information about the ffmpeg-cvslog
mailing list