portapack-mayhem / mayhem-firmware

Custom firmware for the HackRF+PortaPack H1/H2
GNU General Public License v3.0
3.05k stars 520 forks source link

Improved audio beep tone #2014

Closed NotherNgineer closed 4 months ago

NotherNgineer commented 4 months ago

Improved audio quality of RSSI beep tone.

Explanation example: Audio DMA uses a 128-sample buffer. For a 1KHz tone and a 24KHz sample rate, each sine wave has 24 samples. But 128/24 = 5.3333, i.e. 5 full sine waves plus a partial wave.

Instead of always sending 128 samples to the audio chip, this PR tweaks the number of samples to eliminate sending that partial sine wave which was causing distortion. In the above example, 5 complete sine waves (5 x 24 samples) will be sent instead of 5.333 sine waves.

NotherNgineer commented 4 months ago

Now I just have to wait for some weather balloon to fly over. :-)

gullradriel commented 4 months ago

I need to add this in Level app, the beeeeep !!!

NotherNgineer commented 4 months ago

FYI, I will have another fix coming for the beep when clicking the Beep checkbox in the Sonde app. Currently the "request_beep" function only makes a sound if the RSSI level is high enough, so I'll need to modify that baseband message to allow beeps of any audio frequency regardless of RSSI level.

frangonzas commented 4 months ago

@NotherNgineer Eres un genio, gracias por todo el trabajo, cada día entro para ver tus obras maestras.