Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 07:35 29 Nov 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : Another way to do audio from a uP

Author Message
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9139
Posted: 05:59pm 06 Apr 2023
Copy link to clipboard 
Print this post

One limitation of uP is that the maximum PWM rate is limited by the CPU clock and the accuracy of the output as an analogue signal is then also limited

so in the case of the Pico 133MHz/44100 = 3015 steps = 11.5 bits of accuracy

However, there is a way of getting much more accuracy by combining two PWM signals for each audio channel

This is explained here

In this case with two channels you could have 16-bit accuracy with a much higher PWM frequency making filtering much easier or possibly unnecessary at all

Say 133MHz/(44100*11) = 274 steps. Now with two channels running together combined in a 256:1 ratio as in the document we get 16-bit accuracy with 11 PWM waves for each audio level at a PWM frequency of 44100*11 = 485KHz
 
stanleyella

Guru

Joined: 25/06/2022
Location: United Kingdom
Posts: 2134
Posted: 06:23pm 06 Apr 2023
Copy link to clipboard 
Print this post

Hasn't "sound" got out of hand a bit?
I personally would like the filter in the manual with preferred value caps.
What are people expecting the sound to do?
The carrier freq is not a problem in reality.
wav sounds ok.
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9139
Posted: 06:32pm 06 Apr 2023
Copy link to clipboard 
Print this post

The point of the post was academic interest in a interesting and clever approach.
You are free to do whatever but some of us find pushing the envelope stimulating
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6102
Posted: 08:59pm 06 Apr 2023
Copy link to clipboard 
Print this post

It is amazing what can be done with a bit of imagination.
I have some 74LS14 ICs and I might even have the 74HC14 as well so something to play with.

Jim
VK7JH
MMedit   MMBasic Help
 
hitsware2

Guru

Joined: 03/08/2019
Location: United States
Posts: 713
Posted: 09:07pm 06 Apr 2023
Copy link to clipboard 
Print this post

How about a ' r - 2r ' ladder connected to 8 pins configured as a ' PORT ' ?
my site
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4254
Posted: 09:26pm 06 Apr 2023
Copy link to clipboard 
Print this post

Good find Peter, interesting...

Combination of PWM and DAC (resitors)...

Volhout
PicomiteVGA PETSCII ROBOTS
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4254
Posted: 09:27pm 06 Apr 2023
Copy link to clipboard 
Print this post

  TassyJim said  It is amazing what can be done with a bit of imagination.
I have some 74LS14 ICs and I might even have the 74HC14 as well so something to play with.

Jim


Forget about 74LS14's. These do not output rail to rail.
PicomiteVGA PETSCII ROBOTS
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4254
Posted: 09:35pm 06 Apr 2023
Copy link to clipboard 
Print this post

  stanleyella said  Hasn't "sound" got out of hand a bit?
I personally would like the filter in the manual with preferred value caps.
What are people expecting the sound to do?
The carrier freq is not a problem in reality.
wav sounds ok.


This could give you true CD quality audio from a picomite. Not the 80ś game sounds.
But you would need a full PWM for left channel (2 outputs) and a full PWM for right channel (2 outputs) and you would need 2 of these 74HC14 circuits.

And Peter would need to adapt the audio core to support this dual PWM's.

Question...is it worth it....?

Or should we try to connect a I2S audio DAC. Dual 16 bit DAC and includes analog volume control.

Volhout

P.S. For me picomite audio is good enough. I can live with the 44kHz PWM version, and may try the 12 bit DAC one day. But not any day soon.
Edited 2023-04-07 07:37 by Volhout
PicomiteVGA PETSCII ROBOTS
 
Turbo46

Guru

Joined: 24/12/2017
Location: Australia
Posts: 1611
Posted: 09:45pm 06 Apr 2023
Copy link to clipboard 
Print this post

  Stan said  Hasn't "sound" got out of hand a bit?
I personally would like the filter in the manual with preferred value caps.
What are people expecting the sound to do?
The carrier freq is not a problem in reality.



  Peter said  some of us find pushing the envelope stimulating

And without people doing that, there would be little or no advances. So 'pushing the envelope' should be encouraged, not criticised.

The sound 'business does have me a little bemused though. We have sound sources and amplifiers with amazing specs and then we feed the output into a loudspeaker none of which can come anywhere near the performance of the rest of the gear.

Now vinyl records are coming back and turntables with their wow and flutter. People still talk of the 'warm' sound of their valve amplifiers. Go figure.

Thanks Peter that is interesting.

Bill
Keep safe. Live long and prosper.
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9139
Posted: 09:48pm 06 Apr 2023
Copy link to clipboard 
Print this post

I only raised this out of intellectual interest and certainly won't be implementing it. The port with the best audio is the MMX which has a fully functional 24-bit I2S output. It's a pity the RP2040 doesn't support I2S. I believe it can be done with PIO but ties up a lot of resource compared to dedicated H/W. In the meantime output quality with the inductor filter or the DAC is pretty much indistinguishable from "hifi" if using a decent amp and speakers and the Pico has a good low impedance power supply.
 
hitsware2

Guru

Joined: 03/08/2019
Location: United States
Posts: 713
Posted: 11:00pm 06 Apr 2023
Copy link to clipboard 
Print this post

  Turbo46 said  
The sound 'business does have me a little bemused though. We have sound sources and amplifiers with amazing specs and then we feed the output into a loudspeaker none of which can come anywhere near the performance of the rest of the gear.

Sound quality is not cumulative though .
I . E .
The difference between 2 amplifiers can be discerned
through speakers of much worse fidelity than either .
my site
 
phil99

Guru

Joined: 11/02/2018
Location: Australia
Posts: 2140
Posted: 11:20pm 06 Apr 2023
Copy link to clipboard 
Print this post

My unhelpful contribution.

I can discern the difference between 9 / 2 = 5 and 9 / 2 = 4 but they are both wrong!

Objective fidelity is set by the weakest link (integers in the above example).
HiFi is a product of the imagination an can be whatever you want it to be.
 
stanleyella

Guru

Joined: 25/06/2022
Location: United Kingdom
Posts: 2134
Posted: 01:52pm 07 Apr 2023
Copy link to clipboard 
Print this post

I tried playing a wav file from the lcd sd card through various Logitec powered amp/speaker/sub woofers and plugged into aux on a "ghetto blaster" and it sounds "fine", ie I can't tell the difference from the mp3 file playing from windows to the speakers and the mp3 to wav converted file playing from picomite to same test speakers... but then I'm 69 and apparently can't hear over 1kHz :)

I had a quad 22 valve amp and large 12" wharfdale speakers and a garrard zero tracking vinyl deck but when mp3 became popular, digitised my music. 100 lp's on a stick.
 
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024