![]() ![]() ![]() Using a software to analyze “ FIESTAR(피에스타) _ Mirror.mp3”, we can see that there is a free fall of the strength values at the 16000Hz frequency.īack to Unity, Debugging the spectrumdata’s values, there is also a significant decrease at spectrumData. So let’s try to figure it out through some tests. Unfortunately, we can’t get the frequency, the x, of a element(but well the strength which is y) at runtime and I can’t find any clue in the Unity documentation either. The length of the spectrumData array is actually the Frequency Resolution and every array’s element has a x/y value in the diagrams above. They show that the higher the Frequency Resolution the denser the datas transformed. The charts below are the results of the FFT of the demo audio. The reciprocal of T, $f_s/N$, is called Frequency Resolution. Given the sampling time T, the samples N and the sampling rate $f_s$, we can make a formula: $T=N/f_s$. BlackmanHarris ) The spectrum datas and the Fourier transform GetSpectrumData ( spectrumData, 0, FFTWindow. Public float spectrumData = new float thisAudioSource. There is a trade-off of the complexity of the window-function for reducing the noises. Window: A helper function for the FFT to reduce noises. Setting to 0 will sample all channels, as same as in case of mono. In this case, the channel parameter can be used to choose a certain channel to sample by the FFT. To be optimized for the Fourier transform algorithm, the length of the array must be the power of two, minimal 64 and maximum 8192.Ĭhannel: Stereo seperates a audio source into different parts, or say channels, and provided them to distanced audio hardwares to play. Each element’s value is the strength of the audio source at a certain frequency. Samples: The array is the return value of the funciton. Public void GetSpectrumData(float samples, int channel, FFTWindow window) Understand the Unity GetSpectrumData function In this artikel, the strength of the sound wave is a relative value and has nothing to do with the decibel. Window Function: To reduce the “signal to noise ratio”.ĭecibel: A well-known value used to measure sound’s volume. Sampling Rate: The times of the Sampling per second.įast Fourier Transform: the FFT can used to transform signals. Sampling: Get a sample, a value, from a sound wave. Sound Frequency: The times that sound viberated per second. Sound: A sort of wave, viberated in the air with a frequency between 20Hz and 20000Hz. ![]() Take a gander at some terminologies and concepts Provide the spectrum datas to the audio visulizer.The spectrum datas and the Fourier transform. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |