Something I am doing is not quite right. The following example works almost perfectly but please read on.
rtl_fm -f 88.3e6 -M wbfm -s 215000 -r 44100 - | aplay -r 44.1k -f S16_LE
The audio from the sound card is nearly excellent.
To record this stream, I do the following:
rtl_fm -f 88.3e6 -M wbfm -s 215000 -r 44100 testfile.bin
I get a file so it would appear that the following should sound just like the stream I am listening to using the pipe in the first example.
aplay -r 44.1k -f S16_LE testfile.bin
The pitch of the audio is fine but instead of almost dead silence between words, there is a lot of hiss and distortion. In theory, I should hear the same mostly noiseless audio I hear in the first example when playing from the file.
This is really not a DSP issue but maybe I have saved the audio as unsigned and am trying to play it signed which would preserve the pitch but be a cause for a lot of distortion. Besides, it is apparently signed when piped in to aplay.
I am mystified.
Thanks.
Martin McCormick
I made a mistake, all right. We have a radio station affiliated with a university, here. There is a transmitter meant for this city on 88.3 MHZ and another transmitter on 91.7 MHz serving Oklahoma City. Both transmitters are easily receivable here but the 88.3 MHZ transmitter is much stronger. If I use that transmitter and attach any kind of antenna to the dongle, the audio is distorted, apparently because it overloads the device. There was also an audible whine on either signal which wasn't too loud, but was distracting.
I finally discovered that I could get an almost perfect signal from the nearer 88.3 MHZ transmitter and the whine went away if I changed the 200 KHZ output sample rate to 215 KHZ.
FM stations in North America often transmit a digital stream containing a digital version of their analog signal plus a second unrelated digital stream of classical music or alternative program material.
The carrier for this digital stream is near 200 KHZ and I think the 200 KHZ sampling frequency heterodynes with the data carrier.
If one sets this sampling rate to 500 KHZ, for example, you can hear the data carrier mixed in with the audio. What you hear is a noise like an electric motor running in the background.
I set the shell script that directly feeds the stream to the sound card to listen to our 88.3 MHZ signal and forgot to change the recording script also to 88.3. It was still on 91.7 and I just missed that omission since I see both 88.3 and 91.7 a lot when experimenting with the scripts.
After discovering the mistake and setting the record script to 88.3 MHZ, the data recorded are producing sound that is the same, now as one would expect.
I was using a very limited antenna for reception of the local signal so the more distant signal was audible but just barely.
Martin