Re: Processing stereo data?
Re: Processing stereo data?
- Subject: Re: Processing stereo data?
- From: Rick Mann <email@hidden>
- Date: Wed, 09 Mar 2011 14:09:22 -0800
On Mar 9, 2011, at 13:48:10, Brian Willoughby wrote:
>
> On Mar 9, 2011, at 00:54, Rick Mann wrote:
>> I was able to get the simple gain change to work by subclassing ProcessBufferLists(). I then tried doing my more complex processing (which is to treat left & right as I and Q samples from a downconverted radio front-end). The overall operation is straightforward (as described here: http://www.nonstopsystems.com/radio/article-sdr-is-qs.pdf):
>>
>> newSample = (Q * lastI - I * lastQ) / (I * lastI + Q * lastQ);
>>
>> But I get nothing but crackliness. Clearly I'm not doing something right. Could be the incoming data is not what I expect, either. I'll consult with my radio friend and see what he has to say.
>
> My first hunch was that perhaps you were naively using int instead of float. But it may be as simple as needing to divide by 2 in the equation above to avoid clipping. The canonical format for CoreAudio is 32-bit float, but the values should be fractions with an absolute value less than 1.0, or else the output will distort. You can exceed 1.0 in the middle of a graph of signal processing, but the final output must be brought back down within the normal range.
All float, and I did multiply by 0.5 to thwart clipping.
I did just read elsewhere that "lastI" and "lastQ" should be the difference between the current and the last sample. Not sure if that is incorrect, or if the original paper is incorrect.
--
Rick
_______________________________________________
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