# Generate buzzer sound

I'm trying to generate a buzzer sound like this one in matlab.

When you look at the waveform, it's got sinusoidal notches cut into an otherwise normal looking sinewave.

I generate a sinewave tone,

fs = 44100 ;
t = 0 : (1/fs) : 2 ;
f = 200 ;
y = 0.5*(sin( f*2*pi*t )) ;
sound( y, fs ) ;


I don't know how to cut the notches! How would you do it, so it sounds "buzzy"?

The spectrum:

-
Look at a spectrum of the signal. Maybe that software has a spectrum analyzer or else download Audacity or convert to wav and open the file in Matlab. –  endolith Dec 5 '12 at 1:23

## 1 Answer

Based on the spectrum, it looks to me like this was generated by FM synthesis. The mathematics of starting with a sound and working backwards to generate it using FM synthesis can be time consuming. The best reference I know of is Computer Music. I've seen pdf editions of this book online that I thought were legal, but I'm only seeing illegal looking things now, so I'm not linking.

Some simpler approximations that might work, but almost certainly won't sound the same:

1. white noise with a bandpass filter. (maybe plus a little clipped sine wave)
2. a clipped sine wave or square wave through a low pass filter. (subtractive synthesis)
-