Synthesize simple sound waveforms (1) favorites
When I first started studying audio files half a year ago, I made a small program to synthesize simple waveforms in order to have a perceptual knowledge of the audio files. Today, let's review this program to make a summary of audio analysis. This article will briefly introduce the wave file and synthesize three simple waveforms. In this way, we try to give a preliminary understanding of audio.
Before that, have you ever wondered why old black and white TVs make so ugly sounds when they cannot receive signals? Why do we use the harsh voice as the ringtone for old-fashioned phones? Next we will give you a closer understanding of this.
The first thing we need to synthesize is the sound of a sine signal. According to the principle of Fu Ye transformation, the vast majority of signals can be expressed in the form of Sine Signal superposition. First, let's listen to the basic elements that make up other colorful sounds. Click the play button below to play the audio file.
How does it feel? monotonous, harsh, not nice, right?
The second one is to synthesize a Rectangular Wave. The waveforms synthesized here are not monotonous duplicates of the same rectangle, so as to synthesize interesting sounds. If it is just a simple repetition, we can only get monotonous sounds. This waveform is synthesized by two rectangles. The period of one rectangle wave is twice that of the other, and is switched every 600 samples. Click the play button below to play the audio file.
Are you familiar with it? By the way, it is the ringtone. That is to say, the old phone ringtones are rectangular waves. Why do we use rectangular waves? I personally think it is easy to implement. The part of the phone that sends a ringtone is an electronic component, and it processes continuous signals, as long as it simply changes the holding time of this component level, we can easily synthesize the ringtones we hear.
The above two waveforms are both regular, so what will the random signal look like? The code to generate random signals is simple, that is, to randomly fill the amplitude in the audio data. Click the play button below to play the audio file.
Are you familiar with it? When the TV cannot receive a signal, it will make such a sound. Specifically, it does not receive a signal, but does not receive a signal from the radio station and receives a random signal. However, the current color TV is fine, and you will judge whether the received signal is a random signal. If you do not play the sound, you will not hear the harsh sound.
Click here to download the code for merging the wave file in this article. The code is written in C and compiled in Win XP + vs.net 2003. .
This article from the csdn blog, reproduced please indicate the source: http://blog.csdn.net/thinkport/archive/2008/04/05/2253363.aspx