Re: FFT ouput with float buffer AudioUnit
Re: FFT ouput with float buffer AudioUnit
- Subject: Re: FFT ouput with float buffer AudioUnit
- From: Dave Fernandes <email@hidden>
- Date: Sat, 29 Sep 2012 14:11:00 -0400
Hi Julien,
What exactly are you plotting here? Amplitude (real or imaginary part)? Power in dB? How exactly did you compute it? Did you apodize? It is not clear there is anything "bad" with this result. It depends on what you were trying to compute. It would help if you posted all the code that produced this result and stated what the end objective is.
Dave
On 2012-09-28, at 11:01 AM, julien rolland <email@hidden> wrote:
> Hi there,
> I have a problem with vDSP_zrip & AudioUnit usage and configuration. In fact I
> configured AudioUnit to save packed data as float.
> I create a circular buffer and when this buffer is full I compute an fft on it.
> I have a result but I don't understand why fft ouput is bad (cf figure)
> I record a generated sound at 1kHz.
>
> AudioUnit configuration :
>
> // describe format
> AudioStreamBasicDescription audioFormat;
> audioFormat.mSampleRate = 44100;
> audioFormat.mFormatID = kAudioFormatLinearPCM;
> audioFormat.mFormatFlags = kAudioFormatFlagsNativeEndian|kAudioFormatFlagIsPacked|kAudioFormatFlagIsFloat|kAudioFormatFlagIsNonInterleaved;
> audioFormat.mFramesPerPacket = 1;
> audioFormat.mChannelsPerFrame = 1; // mono
> audioFormat.mBitsPerChannel = sizeof(float) * 8;
> audioFormat.mBytesPerFrame = audioFormat.mChannelsPerFrame * sizeof(float);
> audioFormat.mBytesPerPacket = audioFormat.mFramesPerPacket * audioFormat.mBytesPerFrame;
>
> Circular buffer:
> _audioSample = new AudioSample(8192, 44100); // 8192 is the capacity in bytes
> // in recording callback :
> for(int i = 0; i < bufferList.mNumberBuffers; ++i)
> {
> if(!status)
> {
> if(_sample->needData())
> _sample->put((float*)bufferList.mBuffers[i].mData,
> bufferList.mBuffers[i].mDataByteSize);
> [...]
> }
> }
>
> Cheers
> <sound.eps>_______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Coreaudio-api mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden