Obelix27
Posts: 3
Joined: Sat May 23, 2020 1:47 pm

Pi4 3.5mm audio out cuts off at 19kHz

Sun Jun 28, 2020 3:24 pm

Hi - I'm playing 192kHz / 24bit pink noise .WAV files on the Pi via VLC and take the output from the 3.5mm headphone output. The output cuts off very sharply at about 19kHz. Any idea why this is? My measuring equipment is certainly good to 35kHz so I am pretty sure it is the Pi's output. Is the Pi's DAC only capable of 44.1kHz? Or is there a very steep filter on the output?
Attachments
Pi4 3.5mm 2 TascamLineIn, play AudioCheckNet 192kHz pink noise on VLC on Pi.jpg
Pi4 3.5mm 2 TascamLineIn, play AudioCheckNet 192kHz pink noise on VLC on Pi.jpg (220.85 KiB) Viewed 351 times

User avatar
Imperf3kt
Posts: 3562
Joined: Tue Jun 20, 2017 12:16 am
Location: Australia

Re: Pi4 3.5mm audio out cuts off at 19kHz

Sun Jun 28, 2020 10:17 pm

There is no DAC on the Pi 3.5mm audio jack. That output is analogue and considered low quality.

If you want high quality audio output, you'll need to add your own or use the HDMI output.
55:55:44:44:4C
52:4C:52:42:41

cleverca22
Posts: 490
Joined: Sat Aug 18, 2012 2:33 pm

Re: Pi4 3.5mm audio out cuts off at 19kHz

Sun Jun 28, 2020 11:35 pm

the headphone jack is just 2 PWM channels being fed thru a low-pass filter to convert it into fake analog out, your likely seeing the low-pass filter cutting things off

User avatar
PeterO
Posts: 5821
Joined: Sun Jul 22, 2012 4:14 pm

Re: Pi4 3.5mm audio out cuts off at 19kHz

Mon Jun 29, 2020 5:55 am

Imperf3kt wrote:
Sun Jun 28, 2020 10:17 pm
There is no DAC on the Pi 3.5mm audio jack. That output is analogue
"In electronics, a digital-to-analog converter (DAC, D/A, D2A, or D-to-A) is a system that converts a digital signal into an analog signal." (from wikipedia)
So something on the PI board is acting as a DAC. The there is a list of types of DAC on that wikipedia page (see https://en.wikipedia.org/wiki/Digital-t ... rter#Types) which includes the PWN technique used on the PI. Just because you can't point at is and say "That's the DAC" in the way you can with an external DAC mounted on a HAT, doesn't mean the PI doesn't have one :roll:

PeterO
Discoverer of the PI2 XENON DEATH FLASH!
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson

gordon77
Posts: 4974
Joined: Sun Aug 05, 2012 3:12 pm

Re: Pi4 3.5mm audio out cuts off at 19kHz

Mon Jun 29, 2020 6:16 am

Here's the pi schematic of the DAC conversion.
It should be possible to determine its frequency response.
Attachments
IMG_20200629_071445.jpg
IMG_20200629_071445.jpg (45.87 KiB) Viewed 265 times

User avatar
Burngate
Posts: 6284
Joined: Thu Sep 29, 2011 4:34 pm
Location: Berkshire UK Tralfamadore
Contact: Website

Re: Pi4 3.5mm audio out cuts off at 19kHz

Mon Jun 29, 2020 10:45 am

The low-pass filter shown there gives 6dB/octave with a 3dB turnover at 145kHz. Not what's shown on his graph, which has a 3dB turnover at 19kHz and thereafter something in excess of 18dB/octave.

What frequency does the Pi's PWM work at?
What does the Pi do to the audio before it feeds into the PWM?
Why should my ears care what happens above 19kHz? (after all, my ears is what the trrs socket is meant to feed, not bats' ears or other detector!)
Last edited by Burngate on Thu Jul 02, 2020 8:37 am, edited 1 time in total.

jdb
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 2344
Joined: Thu Jul 11, 2013 2:37 pm

Re: Pi4 3.5mm audio out cuts off at 19kHz

Mon Jun 29, 2020 3:26 pm

You are seeing the roll-off of the 512-tap FIR lowpass filter implemented in firmware, not the PWM filter response.
The filter chain takes any arbitrary input samplerate and converts it to a fixed 48.828kHz, before mixing all input sources together. Then there is an upsampling and noise shaping stage with an eventual output carrier frequency of 781.25kHz.
Band limiting is essential for the sigma-delta modulation scheme to work - its effectiveness depends on the signal power being effectively zero outside of the audio band.
Rockets are loud.
https://astro-pi.org

User avatar
Burngate
Posts: 6284
Joined: Thu Sep 29, 2011 4:34 pm
Location: Berkshire UK Tralfamadore
Contact: Website

Re: Pi4 3.5mm audio out cuts off at 19kHz

Tue Jun 30, 2020 10:58 am

Essential reading: viewtopic.php?f=29&t=136445

Return to “Interfacing (DSI, CSI, I2C, etc.)”