jgaeddert / liquid-dsp

digital signal processing library for software-defined radios
http://liquidsdr.org
MIT License
1.87k stars 439 forks source link

Problems generation pure sine wave for FM transmission. #303

Open righthalfplane opened 1 year ago

righthalfplane commented 1 year ago

@jgaeddert I would like to generate a FM transmission with pure sine waves, but I have run into some problems. For FM I usually use the "freqmod_modulate_block" and it sounds Ok with music and talk, but simple sine waves have a problem. With a single sine tone it generates a tone at plus and minus the frequency. With two sine tones it generates a huge amount of junk (plot 1). With AM, I solved the problem by generating the signal using complex sine waves, but the "freqmod_modulate_block" has no complex input option. I tried down sampling the signal and that helped a lot (plot 2), but it generates not only the +-500 and +-2000 - it also has +-1000, +-1500, +-2500 and +-3000. You may also note that the sine wave has the 500 and 2000 hz signals both have 0.1 amplitude (plot 3), but the output of the fftw3 gives different values even in the plot of the simple signal (plot 4). Using my fft routines the amplitudes are the same for the plot 4 signal - fftw3 has some sort of problem. Is there some thing like "freqmod_modulate_block that takes complex input ?

I have include the test program at the end.

NoResample

fftwmodulate

SineWaves

fftsine

simpleTone.txt