Products > Programming

Implement pre-emphasis filter in C

(1/2) > >>

Zipdox:
I'm working on an audio plugin for FM stereo multiplexing with RDS. I got the stereo multiplexing working but I'm running into problems with the RDS carrier.

The system runs at 192kHz sample rate. The RDS carrier is 57 kHz.

The problem is that when I switch the RDS carrier on and off, I get a lot of nasty harmonics. What would be the best approach to deal with these?

The code: https://gitlab.com/zipdox/fmgen.lv2/-/blob/rds/fmgen.c

Zipdox:
It appears I had no idea what I was doing and the Wikipedia page for RDS doesn't contain any information about the modulation type.

Anyway, now that I have figured out the manchester coding, I need to figure out the pulse shaping filter.
http://www.interactive-radio-system.com/docs/EN50067_RDS_Standard.pdf
The specification specifies "cosine rolloff". I have no idea how to implement this. This document specifies a raised-cosine filter, while this repo specifies a root-raised-cosine filter. I guess maybe I could steal some code from that repo.

And these
https://github.com/ChristopheJacquet/Pydemod/blob/master/src/pydemod/app/rds.py#L42
https://github.com/ChristopheJacquet/Pydemod/blob/master/src/pydemod/filters/shaping.py#L15

Zipdox:
Looks like I figured it out.

SiliconWizard:

--- Quote from: Zipdox on January 12, 2023, 05:39:13 pm ---Looks like I figured it out.

--- End quote ---

I have used RDS in the past but never implemented the modulation myself. Certainly interesting, although (as you noticed), there's probably a near-zero number of people on here that have ever done that.

Didn't really look at your source code, my quick guess is that you may have needed to switch the carrier on zero-crossings to avoid unwanted harmonics. Is it what you did?

Zipdox:

--- Quote from: SiliconWizard on January 12, 2023, 07:28:52 pm ---Didn't really look at your source code, my quick guess is that you may have needed to switch the carrier on zero-crossings to avoid unwanted harmonics. Is it what you did?

--- End quote ---
No, that's what I tried doing originally. The problem was that it's impossible to switch exactly at the zero-crossing with such a high frequency, and a sample rate that isn't a multiple of said frequency.

But that isn't the problem. That's not actually the proper way to even modulate the signal. The proper way is described in the specification PDF I linked. Basically you manchester encode the bitstream, turn the signal into short negative and positive pulses, run the signal though a pulse shaping filter (in this case a root-raised-cosine filter), and finally multiply the signal by the carrier sine wave (57 kHz). This multiplication results in a double-sideband surpressed-carrier signal (whatever that means) as shown below.

Navigation

[0] Message Index

[#] Next page

There was an error while thanking
Thanking...
Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod