I need to generate a bird chirp with the Mega128

Go To Last Post
9 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello Everyone,
I want to generate a bird singing or bird chirp after an event using the Mega128. I have researched many ways of doing this but I am having problems writing code for the Mega128 to generate a bird.

One candidate is to use the SpeakJet chip but it is too expensive and too complicated to use. I can make the chip say words but I cannot make it speak 'bird'. :lol:

Another candidate is to use PWM, an audio amp and a speaker, But how would I use an onboard timer to generate various frequencies of a bird? I guess I have to know these frequencies ahead of time.

Thanks,
Tim

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
I am having problems writing code for the Mega128 to generate a bird.
I'm not quite sure what God used to generate birds :lol:

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Somehow, you need to descrribe the bird "chirp". There are lots and lots of them. That aside, you need tio start with some sort of descriptiive data set. Perhaps "wave file". Perhaps compressed data. Then, you need to convert that data into a sequence of numbers (that can be output by a DAC, PWM, etc). Then, you need the electronics to convert the voltage sequence into audio (amplifier and speaker, perhaps).

It seems to me that your first challenge is to get a data set that you can work with. MP3 probably isn't so good though there are AVR-based mp3 players out there. Once you have the data set, THEN you can start dealing with code and output issues.

Jim

Jim Wagner Oregon Research Electronics, Consulting Div. Tangent, OR, USA http://www.orelectronics.net

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
you need to descrribe the bird "chirp".
A kookaburra's 'chirp' is quite different than a budgie. In Canada they use bird chirps for pedestrian crossing signal I believe, one signal sounds like a cuckoo and the other sounds like an owl...these signal are quite easy to generate, but if you have enough memory the above suggestion af a wave file would be the best sounding one.

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

tec wrote:
Hello Everyone,
I want to generate a bird singing or bird chirp after an event using the Mega128. I have researched many ways of doing this but I am having problems writing code for the Mega128 to generate a bird.

First you make a steady tone (few kHz, lets say 4kHz?)
This tone needs a pattern on and off.

Trrrr Trrr Trrr

first a fast shirpy sound, then slower,tjirp tjirp tjirp tjirp tjiiiiiirp
tjiiiiiirp
Each shirp has tones which change in frequency.
Setup all parameters, freq, speed, duration, repititions.
or do some random with all the parameters, this will be a special bird. :idea:

Check out http://www.birdix.com and look at the sonograms of the bioacoustics of the birds. 8)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I think some 'sweep up' and 'sweep down' from 1k to 4k in 300 ms, 300ms silence, repeat 3 times would sound ok... like 'whit whit whit' sweeping up. So youd be sweeping 3k in 300ms... so jump up 100hz, beep for 10ms, repeat

Imagecraft compiler user

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

tec wrote:
Another candidate is to use PWM, an audio amp and a speaker, But how would I use an onboard timer to generate various frequencies of a bird? I guess I have to know these frequencies ahead of time.

If you want to go cheap you can probably get by with a piezo speaker since birds tend to be tweeters (har!). The Butterfly generates a passible wolf whiste using PWM and all the source code needed is freely available. You will need to find or build a data table though with the tones and timing.

Good Luck,
Smiley

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I am using speakjet with tts256 and atmega32...but it just says ready...it doesn't says any word sent

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

And what has this to do with an 8 years old thread?

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly