# Frequency analysis

**URL:** https://qa.fmod.com/t/frequency-analysis/12000
**Category:** FMOD Engine
**Created:** [July 28, 2015, 9:54pm UTC](https://qa.fmod.com/t/frequency-analysis/12000 "2015-07-28T21:54:23Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Joseman](https://avatars.discourse-cdn.com/v4/letter/j/919ad9/32.png) [@Joseman](https://qa.fmod.com/u/Joseman)
#### Post date: [July 28, 2015, 9:54pm UTC](https://qa.fmod.com/t/frequency-analysis/12000/1 "2015-07-28T21:54:23Z")

</div>

Hi,

I’m new on FMOD and it looks very cool to me.  
I’m trying to get a frequency spectrum with the low-level-api but I can’t find any information how this will work.  
First I try this:

> **[Cutting Your Teeth on FMOD Part 4: Frequency Analysis, Graphic Equalizer,...](https://katyscode.wordpress.com/2013/01/16/cutting-your-teeth-on-fmod-part-4-frequency-analysis-graphic-equalizer-beat-detection-and-bpm-estimation/)**
>
> In this article, we shall look at how to do a frequency analysis of a playing song in FMOD and learn how to use this as the basis for a variety of useful applications. What is frequency analysis? N…

  
The Problem is that “Channel::getSpectrum(…)” no longer exist, or?  
So… can anyone telle me how is the right way to to this with the new version?

Greez  
Joseman

btw:  
I hope my english is good enough…

---

<div class="post-metadata">

### Author: ![nick1](https://avatars.discourse-cdn.com/v4/letter/n/47e85d/32.png) [@nick1](https://qa.fmod.com/u/nick1)
#### Post date: [July 30, 2015, 1:09am UTC](https://qa.fmod.com/t/frequency-analysis/12000/2 "2015-07-30T01:09:14Z")

</div>

Create a FFT DSP and add it to the channel. You can then query the frequency domain data using DSP::getParameterData(FMOD\_DSP\_FFT\_SPECTRUMDATA, …)

---

<div class="post-metadata">

### Author: ![Joseman](https://avatars.discourse-cdn.com/v4/letter/j/919ad9/32.png) [@Joseman](https://qa.fmod.com/u/Joseman)
#### Post date: [July 30, 2015, 8:59am UTC](https://qa.fmod.com/t/frequency-analysis/12000/3 "2015-07-30T08:59:55Z")

</div>

Hallo,

I’ve got it. Thanks.  
The Code:

FMOD::DSP\* dsp;  
mFMODSystem-\>createDSPByType(FMOD\_DSP\_TYPE::FMOD\_DSP\_TYPE\_FFT, &dsp);  
mFMODSystem-\>playSound(mSound, 0, false, &channel);  
channel-\>addDSP(FMOD\_DSP\_PARAMETER\_DATA\_TYPE\_FFT,dsp);  
FMOD\_DSP\_PARAMETER\_FFT \*fft;  
dsp-\>getParameterData(FMOD\_DSP\_FFT\_SPECTRUMDATA, (void \*\*)fft, 0, 0, 0);  
for (int channel = 0; channel \< 1; channel++)  
for (int bin = 0; binlength; ++bin)  
float freqVal = fft-\>spectrum[channel][bin];

---

<div class="post-metadata">

### Author: ![Lynne](https://avatars.discourse-cdn.com/v4/letter/l/c77e96/32.png) [@Lynne](https://qa.fmod.com/u/Lynne)
#### Post date: [May 17, 2016, 5:40am UTC](https://qa.fmod.com/t/frequency-analysis/12000/4 "2016-05-17T05:40:42Z")

</div>

> [@](#):
>
> Hallo,
> 
> I’ve got it. Thanks.  
> The Code:
> 
> FMOD::DSP\* dsp;  
> mFMODSystem-\>createDSPByType(FMOD\_DSP\_TYPE::FMOD\_DSP\_TYPE\_FFT, &dsp);  
> mFMODSystem-\>playSound(mSound, 0, false, &channel);  
> channel-\>addDSP(FMOD\_DSP\_PARAMETER\_DATA\_TYPE\_FFT,dsp);  
> FMOD\_DSP\_PARAMETER\_FFT \*fft;  
> dsp-\>getParameterData(FMOD\_DSP\_FFT\_SPECTRUMDATA, (void \*\*)fft, 0, 0, 0);  
> for (int channel = 0; channel \< 1; channel++)  
> for (int bin = 0; binlength; ++bin)  
> float freqVal = fft-\>spectrum[channel][bin];

hello,can you write code complete?I’ve had the sample problem as you.
