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
I found that for single frequency sound, I don't need to use any data. What I do, only change the value of DAC from 0x0000 to 0xFFFF and back again from 0xFFFF to 0x0000 every interrupt on T0. The triggered int time is the only key to change.
A square wave is not a single-frequency sound. It's one fundamental frequency with lots of harmonics. Depending on your application, this might be relevant.
I tried to generate sound code using PC's sound recorder, then save it as in format of PCM, 8Khz, 8bit Mono. Extract the data in the file and put it in the code, but the sound is not clear as in PC.
Getting the sound to sound "clear" requires fairly strict timing with little jitter. Even more so if your chip doesn't have DMA facilities to move the sound data to the DAC.
You might have to connect an oscilloscope (and/or a frequency analyzer, or an oscilloscope that can calculate a spectrum) to the DAC to examine the output waveform. Start with simple sine/triangle/sawtooth waves and see if they a re-created without distortion.
Personally, I'd use Matlab (expensive) or GNU Octave (free, and for this purpose pretty much indistinguishable from Matlab, so don't buy a four- to five-figure Matlab license just for this purpose :) ) to generate the waveforms.