Maker Pro
Maker Pro

How can I make Audio Amplifier from 2SK3549-01 MOSFET

Afry

Mar 9, 2020
10
Joined
Mar 9, 2020
Messages
10
The OP said the signal is PCM (audio samples), not PWM (Pulse Width Modulation). The audio system looks like a Bluetooth receiver that would produce ordinary audio
The source sound is PCM but I'm sampling it with PWM (I use the uC for that ) , the original PCM raw file ( I generated from my PC using Audacity and xxd command ) is 8bit 8Khz signal but the uC generate it at twice bandwidth 16KHz to catch up (with the real wave shape ) , (the uC have timer that handle this ) when I set PWM frequency at 8KHz the sound were too noisy with a lot of cracks .
Unfortunately I don't have oscilloscope but the output signal should look similar to this (this is not the actual wave ) .
Delta-PWM-svg.png
 

Audioguru

Sep 24, 2016
3,650
Joined
Sep 24, 2016
Messages
3,650
Many people can hear and many speakers produce your 16kHz audio whistle. Nothing is filtering it away.
 

Nanren888

Nov 8, 2015
623
Joined
Nov 8, 2015
Messages
623
Thanks for the waveforms. I see the lower one is marked "delta PWM"
I'm not sure that I follow this.
The PWM signal appears to follow the slope rather than the voltage. This is as also suggested by the "delta".
It is as if there is an integration somewhere.
I guess for a sineusoid, this would only be a phase change without the integral,. but still, am I missing an extra stage in your processing? Do you have an integral somewhere?
.
As Audioguru points out, the 16kHz carrier is a little low in that people will hear it directly.
Not familiar with modern PWM. Do you have a high enough clock behind the PWM to move the clock up a bit and still get the resolution you want?
 

Afry

Mar 9, 2020
10
Joined
Mar 9, 2020
Messages
10
Not familiar with modern PWM. Do you have a high enough clock behind the PWM to move the clock up a bit and still get the resolution you want?
I'm using bit powerful uC STM32F103 it's runs at 72Mhz and I setup Prescaler (clock divider) on whatever speed I need ,
I'm using the timer to generate PWM signal according to array variable (Lookup table ) that represent PCM values (0-255)
This is complete the code
pwmtimer2.setPrescaleFactor( 17.5 ) ; // this make the timer runs @ ~ 4Mhz
pwmtimer2.setOverflow ( 256 ) ; // this is max value of duty cycle "255 mean straight line "
pwmWrite( PA8 , sample ) ; //send PCM signal to the output pin
I think theoretically this uC can generate very high frequency PWM (maybe 72Mhz )
Anyway for DC sine wave I saw video guy use capacitor on serial with the speaker to shift the wave down .
BTW for the 2SK3549-01 N-CHANNEL MOSFET I connect it gate directly to collect of the transistor drain to the speaker source tho - and heard nothing at all , only if I touch the gate with my finger the circuit activate the voltage reach the speaker .
 
Last edited:

Nanren888

Nov 8, 2015
623
Joined
Nov 8, 2015
Messages
623
OK, so if you have enough clock cycles to use a higher carrier, and still get the resolution you want, then higher is better.
If you arrange a low pass filter on the output, then this may cut the amount of carrier that the speaker sees. As I mentioned, I don;t know much about speakers: they are mechanical and so some will act as a low pass filter naturally. Audioguru said they have a resonance. Maybe that will workj for you.
Your waveforms show the PWM matching the slope of the signal.
In a simple sense, thje higher the carrier, the easier filtering it becomes as the filter cutoff to pass the audio spectrum, but eliminate the carrier gets easier: not as steep.
If you put the PWM signal to a low pass system, then it will see the local average signal, not the slope.
If your PWM waveform represents the audio voltage it will more faithfully represent the audio.
Unless I have missed a filter somewhere in your plan.

Maybe this page will help.
https://learn.adafruit.com/trinket-audio-player/sound-playback
 

Audioguru

Sep 24, 2016
3,650
Joined
Sep 24, 2016
Messages
3,650
Modern class-D audio power amplifiers use PWM at up to 1.2MHz. Their outputs are push-pull with no DC in the speaker. They use a type of modulation that cancels the carrier to avoid transmitting RF interference without using filters.
The Texas Instruments TPA3116D2 stereo amplifier IC produces 2x 50W into 4 ohms or 2x 30W into 8 ohms at low distortion.
Its efficiency is >90%.

The Mosfet amplifier in this thread is class-A which produces very high heating all the time the input signal source is connected, even when the signal source produces no signal.
 

Afry

Mar 9, 2020
10
Joined
Mar 9, 2020
Messages
10
The Mosfet amplifier in this thread is class-A which produces very high heating all the time the input signal source is connected, even when the signal source produces no signal.
I fully understand that but since I'm on budget (I have two project one is adding speakers to OLD PC LCD's , the other is WalkiTalki )
I'll use the uC for the WalkiTalki and since it's only transferring human voices only the quality of sound not priority as long the other side can hear , Anyway before I post this I test the uC output directly to earphone and sound were good I may made the WalkiTalki uses earphone only .
 
Top