简体   繁体   English

加速iOS框架-FFT输入

[英]Accelerate Framework iOS - FFT Input

Hi I have to draw a spectrum graph for the wav file. 嗨,我必须为wav文件绘制一张光谱图。 I am using the AudioFileGetProperty and I am able to retreive the AudioData for the wav file using 我正在使用AudioFileGetProperty并且能够使用以下命令检索wav文件的AudioData

audioData = (SInt16*)malloc( 2 *packetCount); 

from this other question . 另一个问题

Gonna use FFT in accelerate framework. 将在加速框架中使用FFT。 Please do let me know how to get the Frequency. 请让我知道如何获取频率。 I am not sure how the input for FFT should be. 我不确定FFT的输入应该如何。 I currently have the SInt16 audio data. 我目前有SInt16音频数据。

This post on NSBlog describes how to perform an FFT using Apple's vDSP. NSBlog上的这篇文章介绍了如何使用Apple的vDSP执行FFT。 The result of the FFT doesn't give you "a frequency". FFT的结果不会给您“频率”。 It gives you the magnitude and phase of all the frequencies below half the sample rate of your audio. 它为您提供了低于音频采样率一半的所有频率的幅度和相位。 If your input signal is a simple sine wave, just look for the maximum in the magnitude values. 如果您的输入信号是简单的正弦波,则只需寻找幅度值中的最大值即可。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM