Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Decaying sounds synthesis with PWM

Status
Not open for further replies.

amaze1

Junior Member level 2
Joined
Feb 27, 2004
Messages
20
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,283
Activity points
177
Do anyone knows if is it possible synthetizing (no pre-recorded sounds play) with reasonable precision (e.g. acceptable audio quality) decaying sounds like bells, carillons, gongs etc with mcu's PWM only ?
I mean no external programmable amplifiers or so, at least just a passive filter.
Some code example or algorithm welcome.

Thanks in advance
 

Well, the only thing i can think of is doing what the old analog synthesizers used to do: an envelope with a fast attack.
Just use a sine table and an array containing the envelope values. At every sample instance multiply corresponding values of each and use that as the pulse width.

However this sound will be very far from that of real bells. For that you would require frequency modulation.
 
  • Like
Reactions: amaze1

    amaze1

    Points: 2
    Helpful Answer Positive Rating
Well, the only thing i can think of is doing what the old analog synthesizers used to do: an envelope with a fast attack.
Just use a sine table and an array containing the envelope values. At every sample instance multiply corresponding values of each and use that as the pulse width.

However this sound will be very far from that of real bells. For that you would require frequency modulation.

This isn't what I was looking for.
I hoped it is possible mimic the decaying sounds spectrum with PWM's square wave and some kind of frequency or duty cycle modulation.
Thanks so much anyway for your effort

PS: By The Way: how is the spectrum of such decaying sounds ?
 
Last edited:

Sure. :) But I don't think you can modulate the frequency of the PWM wave on the fly in most, if not all, MCUs...don't they just have a prescaler to derive the wave frequency?
And we are doing duty cycle modulation to get an analog wave from a PWM. In the analog synths with PWM, what they had were square waves with specific frequencies mapped to different keys, whose duty cycle could be changed or modulated to get desired effects. In the MCU case we have to modulate the PWM signal to just get the basic waveform.

The spectrum of real bells must be full of harmonics at the attack stage, which would gradually die down to signal of a few harmonics, till it decays away...
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top