• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: AudioConverter 8.24 to Float32
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: AudioConverter 8.24 to Float32


  • Subject: Re: AudioConverter 8.24 to Float32
  • From: William Stewart <email@hidden>
  • Date: Fri, 14 Nov 2008 16:18:23 -0800

Its hard to say in general, but we've seen over 50% improvements with well crafted fixed point/asm code

On Nov 14, 2008, at 3:37 PM, Benjamin Faber wrote:

Bill,

How much slower should we expect floating point operations to be?

I just implemented a 6th order IIR filter with fixed point arithmetic (8.24) and saw less than a 10% performance improvement over the double-precision floating point version of the same filter. The fixed point multiplies were accomplished with inline assembly (the "smull" instruction). The performance improvement is only visible in the Release build, since the fixed-point arithmetic is actually slower in the Debug build. This appears to be consistent between a second-gen iPod touch and the iPhone 3G, although the iPod touch is faster.

Thanks,

Ben Faber



On Nov 13, 2008, at 7:17 PM, William Stewart wrote:

Yes - using floating point on the phone/touch is not a good thing for general DSP work - that is why we provided the 8.24 canonical version and why we would recommend that audio DSP is done in fixed point. It can be done in floating point of course, but it is slow

Bill

On Nov 11, 2008, at 11:08 PM, Mark's Studio wrote:


On 11/11/2008, at 23.10, William Stewart wrote:

(Oh and just to be clear, float is not currently supported on iPhone - it is on the desktop)

??? do you mean i can't use the AudioConverter to convert to float on the iPhone ?




Float64 sampleRate;
size = sizeof(sampleRate);
XThrowIfError (AudioSessionGetProperty (kAudioSessionProperty_CurrentHardwareSampleRate, &size, &sampleRate), "couldn't get new sample rate");
CAStreamBasicDescription destFormat;
CAStreamBasicDescription srcFormat;
outFormat.mSampleRate = sampleRate;

srcFormat.mSampleRate = outFormat.mSampleRate;
srcFormat.mFormatID = outFormat.mFormatID;
srcFormat.mFormatFlags = outFormat.mFormatFlags;
srcFormat.mBytesPerPacket = outFormat.mBytesPerPacket;
srcFormat.mFramesPerPacket = outFormat.mFramesPerPacket;
srcFormat.mBytesPerFrame = outFormat.mBytesPerFrame;
srcFormat.mChannelsPerFrame = 1;
srcFormat.mBitsPerChannel = outFormat.mBitsPerChannel;

destFormat.mSampleRate = outFormat.mSampleRate;
destFormat.mFormatID = kAudioFormatLinearPCM;
destFormat.mFormatFlags = kAudioFormatFlagIsFloat | kAudioFormatFlagsNativeEndian | kAudioFormatFlagIsPacked;
destFormat.mBytesPerPacket = outFormat.mBytesPerPacket;
destFormat.mFramesPerPacket = outFormat.mFramesPerPacket;
destFormat.mBytesPerFrame = outFormat.mBytesPerFrame;
destFormat.mChannelsPerFrame = 1;
destFormat.mBitsPerChannel = outFormat.mBitsPerChannel;


outFormat.Print(outFormat);
srcFormat.Print(srcFormat);
destFormat.Print(destFormat);

XThrowIfError(AudioConverterNew(&srcFormat, &destFormat, &audioConverter), "couldn't get AudioConverterNew");


and then in PerformThru()

AudioUnitRender()
AudioConverterConvertBuffer(....ioData->mBuffer[0].mData,...)

i get a -50 error from AudioConverterConvertBuffer()

is this not possible ?




On Nov 11, 2008, at 2:08 PM, William Stewart wrote:

float is not supported

On Nov 11, 2008, at 7:26 AM, Mark's Studio wrote:

In the aurioTouch sampleCode the format is 8.24 i have tried to add a AudioConverterNew to convert to float, but either i get a -50, or a !fmt error,
it look's like there is already an AudioConverter running maybe for the 16bit to 8.24,
how do i setup the format for the AudioConverterNew so i can have Float32 instead of 8.24,
i am mostly interested in converting the input buffer.






Peter Mark

Mark's Recording Studio A/S
Lundeskovsvej 3
2900 Hellerup
Denmark
Tel: +45 35366078
Fax: +45 35366038
Mobile: +45 20416018
www.marks-studio.dk
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

_______________________________________________ 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


Peter Mark

Mark's Recording Studio A/S
Lundeskovsvej 3
2900 Hellerup
Denmark
Tel: +45 35366078
Fax: +45 35366038
Mobile: +45 20416018
www.marks-studio.dk
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


_______________________________________________ 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
  • Follow-Ups:
    • Re: AudioConverter 8.24 to Float32
      • From: Mark's Studio <email@hidden>
    • Re: AudioConverter 8.24 to Float32
      • From: William Stewart <email@hidden>
References: 
 >AudioConverter 8.24 to Float32 (From: Mark's Studio <email@hidden>)
 >Re: AudioConverter 8.24 to Float32 (From: William Stewart <email@hidden>)
 >Re: AudioConverter 8.24 to Float32 (From: William Stewart <email@hidden>)
 >Re: AudioConverter 8.24 to Float32 (From: Mark's Studio <email@hidden>)
 >Re: AudioConverter 8.24 to Float32 (From: William Stewart <email@hidden>)
 >Re: AudioConverter 8.24 to Float32 (From: Benjamin Faber <email@hidden>)

  • Prev by Date: Re: AudioConverter 8.24 to Float32
  • Next by Date: Re: AudioConverter 8.24 to Float32
  • Previous by thread: Re: AudioConverter 8.24 to Float32
  • Next by thread: Re: AudioConverter 8.24 to Float32
  • Index(es):
    • Date
    • Thread