Android Question modulate a frequency

henry montoya

Member
Licensed User
Hello,

anyone knows how to modulate a frequency generated with beeper or AudioStreamer.

I mean the waveform, sine, square, triangle etc.

Thank you.
 

strat

Active Member
Licensed User
I didn't understand your question. It may be my fault.

Do you want to modulate a frequency in order to carry long distances, or do you want to create a sine,square or triangle waveform programmatically?
 

henry montoya

Member
Licensed User
Hello strat, thanks for answering.
do not worry it's my fault because I did not have explained.
I have seen programs that reproduce frequencies and have the option of reproducing the same frequency with different waveform, triangle, square etc.
I need to do something like that, reproduce the same frequency in different waveform.

thank you
 

JohnK

Active Member
Licensed User
Hello strat, thanks for answering.
do not worry it's my fault because I did not have explained.
I have seen programs that reproduce frequencies and have the option of reproducing the same frequency with different waveform, triangle, square etc.
I need to do something like that, reproduce the same frequency in different waveform.
You almost sound like you are trying to create a Synthesizer (https://en.wikipedia.org/wiki/Synthesizer). Unless you have the requirements of a Synthesizer, you will most likely be better off using samples, or simply having the "samples" as files with the wave functions pre-generated within, and you simply read them and play them back at different speeds. Actually, the streamer already appears to have this functionality built in., so you would simply load the samples from a file (ie replace the sin calcs with a file load in the example)
streamer.Initialize("streamer", 11025, True, 16, streamer.VOLUME_MUSIC)

Other than that, my personal favorite is frequency modulation... https://en.wikipedia.org/wiki/Frequency_modulation_synthesis & https://en.wikipedia.org/wiki/Frequency_modulation A very rich waveform can be generated from a few sine waves, and a LOT of maths. A triangle and square wave approximation can also be generated.
 
Top