This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How to create sound data

hi,

Look at the sample sound for ARM board MCB2130, how to make this sound data (data.c)? in the sample DTMF "1", "5", "9" and "D" is in SoundaData array variable.

If I want to generate data for freq say 350Hz (single frequency) how to make it? so I can put in the array variable similar such as SoundData.

thanks,
Rudy

Parents
  • Note that emitting 0x0000 and 0xffff will emit a square wave. Unless you have a low-pass filter, your output will contain large amounts of energy in overtone frequencies, besides the base frequency.

    A problem when handling PCM data is to make sure that you don't have a signed/unsigned problem.

    The sound recorder is one way, but best when you want to capture speech messages or music. For DTMF or similar, it is normally easier to just sum the sine waves in a C program, and let the program emit the data in text form for direct inclusion in the source code. Wieh you compute the frequencies matematically, it will also be trivial to create a sound clip that has the perfect number of samples for looped playback, i.e. where the clip has n samples and the n+1 sample should have been identical to the first sample.

Reply
  • Note that emitting 0x0000 and 0xffff will emit a square wave. Unless you have a low-pass filter, your output will contain large amounts of energy in overtone frequencies, besides the base frequency.

    A problem when handling PCM data is to make sure that you don't have a signed/unsigned problem.

    The sound recorder is one way, but best when you want to capture speech messages or music. For DTMF or similar, it is normally easier to just sum the sine waves in a C program, and let the program emit the data in text form for direct inclusion in the source code. Wieh you compute the frequencies matematically, it will also be trivial to create a sound clip that has the perfect number of samples for looped playback, i.e. where the clip has n samples and the n+1 sample should have been identical to the first sample.

Children
No data