-
Notifications
You must be signed in to change notification settings - Fork 335
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Static and Very Low Sound Quality on Raspberry pi 2 #50
Comments
I did not notice a difference with the Raspberry Pi 2. Having to tinker with ppm to fix audio defects doesn't sound right either. Is RDS working? |
Hi, thank you for the reply, would there be a specific way to test the RDS? The reason I changed the ppm was because it was playing very slowly which also naturally brought down the pitch of the song. So I increased it to about 75000. |
Poor audio quality - low audio pitch on RPi2. Base Raspbian clock speed is 700 MHz. Was not getting a stereo beacon or RDS data through. I fixed my version of this issue by going into raspi-config and raising the clock speed to 900 MHz. Getting Stereo beacon and RDS data now as well. BTW, I am running no ppm correction. Another issue that I have not been able to resolve by snooping in the code referencing poor audio quality is I do not see any transmission pre-emphasis of the audio, listed either at 75 us or 50 us. A FM receiver has a deemphasis circuit in it so a flat signal will sound muddy and a lack of highs to it. I fixed my version of this by using SOX and treble boost before piping it to PiFmRds. |
On my Raspberry Pi 2 I have bad sound quality, but I also have it on my Raspberry Pi B. The Quality on the Raspberry Pi B is better than on the 2, but not good. |
Here is the command line that I have been using and getting some high quality FM out of this: sox --norm [file].wav -c 2 -t wav - firfit ./75usPreEmphasis.ff | sudo ./pi_fm_rds -freq 88.5 -audio - I am using the 'firfit' option within sox to add the necessary preemphasis for the United States so the audio does not sound so muddy using an FM receiver. The file '75usPreEmphasis.ff' contains the following: 20 0.000 First column is the frequency in Hz and the second column is dB boost to be applied. I extended this out to 24,000 Hz as that is half of the 48000 Hz sampling frequency and will also cover 44,100 Hz sampling as well. Followup: Using 'raspi-config', I selected the 'Pi2' option and that sure helped out on the preprocessing time. |
@itchytweed Thanks, it sounds little bit better to me. |
@itchytweed You're right, there's no pre-emphasis. It's tracked by bug #52 now. A note on "sound quality": don't forget that the program is modulating a square wave as a carrier. Transmitting FM using the RaspberryPi clock in the first place was a feat (cheers to the icrobotics folks!), PiFmRds adds RDS which was kind of a feat too, but don't expect too much on the audio side :) If you want good audio quality, use a proper FM transmitter, not a hack... |
@ChristopheJacquet After using the sox 'firfit' option together with the file which posted @itchytweed the sound quality is actualy pretty good. I belive It can be used as home broadcasting to other room like things. |
i suppose there is an error in the sox/pifm command. and with live audio from cheap usb sound card: Happy hacking :D |
Hi there, I got my best option with the following command: Thanks for your help and enjoy |
One thing that could improve the quality of sound but no one mentions it - the FM deviation. The default value of 25 is ok, but sounds pretty bad & static to me. However after switching to the half, 12.5, the sound quality improved a lot. Sure, its more quiet, but as I said, the sound quality is just better. The deviation is defined here. Simply change it to something like this: |
This is my "75usPreEmphasis.ff" file: 20 0.000 I reduced gain at high frequencies because of too much noise. Also this is my command line to rebroadcast an internet radio: sox -t mp3 http://205.164.62.15:9010/ -t wav -c 2 - firfit ./75usPreEmphasis.ff | sudo ./PiFmRds/src/pi_fm_rds -rt 'Rochenroll Ciulers' -ps RADIO-88 -freq 88.0 -audio - Use P2i overclock to get better performances (1000 Mhz). |
If you want to use sox to play mp3 files or streaming internet radio (mp3), you need to install the following packages: sudo apt-get install sox |
I find this interesting. The way FM broadcast works is the transmitted
signal is pre-emphasized, broadcasted, de-emphasized, and out the
speakers. This was done so any received RF noise is dropped by the
de-emphasis amount for that particular frequency. Cutting the top end
transmit response is like turning down the treble on a flat conversion.
Another consideration here is that this is 75 uSec, which is the U.S.
standard for pre/de-emphasis on the FM broadcast band. I believe that
Europe's standard is 50 uSec.
Kind Regards,
Richard
…On 01/17/2017 12:57 PM, pilovis wrote:
This is my "75usPreEmphasis.ff" file:
20 0.000
100 0.010
200 0.038
300 0.185
400 0.450
500 0.533
600 0.731
700 1.445
800 2.072
900 2.712
1000 2.864
2000 3.042
3000 4.742
4000 6.551
5000 8.129
6000 9.504
7000 10.711
8000 11.784
9000 12.746
10000 13.617
11000 12.412
12000 11.143
13000 10.000
14000 10.446
15000 10.033
16000 10.583
17000 10.101
18000 9.590
19000 8.054
20000 7.494
21000 6.913
22000 5.313
23000 4.696
24000 3.063
I reduced gain at high frequencies because of too much noise.
Also this is my command lite to rebroadcast an internet radio:
sox -t mp3 http://205.164.62.15:9010/ -t wav -c 2 - firfit
./75usPreEmphasis.ff | sudo ./PiFmRds/src/pi_fm_rds -rt 'Rochenroll
Ciulers' -ps RADIO-88 -freq 88.0 -audio -
Use P2i overclock to get better performances (1000 Mhz).
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#50 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AMeLEbF2scpXqod6FxZiYwLmnb6evE2Nks5rTQ8EgaJpZM4HTh6U>.
|
you're right, but I had to cut the treble because of too much noise at high frequencies. |
this is my 75usPreEmphasis.ff file , not a real 75 or 50uS emphasis, but it gives the best audio output, at least here in Europe: 20 0.000 |
Miegl, reducing the deviation from 25 to 12.5 means that you are cutting to the half the audio bandwidth. |
If you wanto to calclulate the correct values for 50 Eu pre-emphas, use the following chart: http://www.radiomuseum.org/forumdata/users/133/Pre_Empf_Bode_590.png |
@pilovis I know. 12.5 just sounds little bit better with current PiFmRds. |
I suggest trying this pull request - #17 |
precise amplitude responses for 50uS (European) pre-emphasis Frequence dB |
Sox firfit is experimental, I read that the maximum knot shoud not go over 15 Khz, because it is not accurate above this frequence and may cause problems. |
I've tried messing with the ppm, and that took care of the low pitch audio. However there is a static in all of the signals, I have tried various sound files on different frequencies. Also I think the audio output it always mono, and the output also sounds like I'm listening to music on my walki talki (very muffled). Is this a Raspberry pi 2 specific thing? I remember reading a few months back that there was super clear FM (almost station quality) for the raspberry pi do none of these work for the 2?
The text was updated successfully, but these errors were encountered: