[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Frequency shift to alleviate acoustic feedback



Hi Steve,

I realized the flaw in my implementation with your patient explanation, thank you very much.

I read another implementation from a book "Acoustic Echo and Noise Control: A Practical Approach". I attached the main flowchart of this implementation, the result was reasonable, and I thought I did the correct implementaion. Looks that simply move FFT coefficients is naive:(

Unfortunately, frequency shift (10Hz shift) doesn't alleviate the feedback problem much, anyway, I will try other kinds of methods.

Thanks,
Siping

On Mon, Jan 28, 2013 at 9:52 AM, Siping Tao <siping.tao@xxxxxxx> wrote:
Hi Julius and Steve,

Thanks for your help, my application scenario requires real-time processing, i.e. delay should be kept below 10ms at most.

Anyway, I think the code of Julius is helpful, to give me a good reference.

Steve, I will read the paper you recommended, thanks, your explaination is very clear. Frequency shift is absolutely harder than I thought :)

Thanks,
Siping

On Sun, Jan 27, 2013 at 5:48 AM, Steve Beet <steve.beet@xxxxxxxx> wrote:
Hi Julius,

That looks like a pretty good implementation of the block-based approach
which Siping wanted to implement. The only problem from Siping's point of
view is that it uses the two functions PV_BinShift() and PV_PhaseShift(),
which are not defined here and may rely on the fact that (in this example)
the FFT size is an exact multiple of the window length. If that is an issue
(or if the 2048-sample length window is important) then Siping would have to
redefine the problem.

I presume the 160-sample blocks were originally specified to keep the
real-time processing delay short. Is that correct, Siping? If so then a
2048-sample window is probably not acceptable.

Steve

> -----Original Message-----
> From: Julius Smith [mailto:jos@xxxxxxxxxxxxxxxxxx]
> Sent: Saturday, January 26, 2013 8:08 PM
> To: Steve Beet
> Cc: AUDITORY@xxxxxxxxxxxxxxx
> Subject: Re: Frequency shift to alleviate acoustic feedback
>
> Hi All,
>
> I don't know if this will help or confuse things, but here is
> a pretty smooth frequency-shifting implementation in SuperCollider:
>
> // Frequency-Shifting Example 5: Add phase-correction
> //   MouseX = amplitude
> //   MouseY = frequency shift (400 * (2 ** MouseY(-1,1)) in [200,800])
> //   MouseButton = clear frequency shift
> // START WITH MOUSE NEAR THE LEFT OF YOUR SCREEN
> (
> x = {
> var in, out, amp, f0=400, fftSize=8192, winLen=2048, hopFrac=0.5,
> chain, mexp, fScaled, df, binShift, phaseShift,
> inWinType=0, outWinType=0;
> amp = MouseX.kr(-60,10).dbamp;
> in = SinOsc.ar(f0,0,amp);
> chain = FFT(LocalBuf(fftSize), in, hopFrac, inWinType, 1, winLen);
> mexp = MouseY.kr(-1.0,1.0);
> mexp = mexp*(1-MouseButton.kr);
> fScaled = f0 * (2.0 ** mexp);
> df = fScaled - f0;
> binShift = fftSize * (df / s.sampleRate);
> chain = PV_BinShift(chain, stretch:1, shift:binShift, interp:1);
> phaseShift = 2 * pi * binShift * hopFrac * (winLen/fftSize);
> chain = PV_PhaseShift(chain, phaseShift, integrate:1);
> out = IFFT(chain,outWinType,winLen);
> Out.ar(0, out.dup);
> }.play
> )
>
> - Julius
>
> At 04:48 AM 1/25/2013, Steve Beet wrote:
>
>
>       Dear Siping,
>
>       I'd agree with Dick's simplification, except to note
> that *if* you can assume that the listeners are not sensitive
> to phase, then frequency shifting is actually very easy - you
> merely have to ensure phase continuity at block boundaries,
> or (my preferred approach) do the processing sample-by-sample
> using a direct analogue of the traditional EE approach:
> heterodyning followed by linear filtering.
>
>       I've also just remembered one reference which is
> relevant to this, and should give you some idea of the issues
> involved in manipulating an audio signal in terms of the
> frequencies, amplitudes and phases of its components:
>
>       R.J. McAulay, T. F. Quartieri; "Speech
> analysis/synthesis based on a sinusoidal representation";
> IEEE Trans. on Acoust., Speech and Signal Proc., vol ASSP-34,
> pp. 744-754, 1986.
>
>       Good luck,
>
>       Steve
>
>
>
>
>       On Thu, 24 Jan 2013 22:41:05 -0800
>       "Richard F. Lyon" <dicklyon@xxxxxxx> wrote:
>
>       > To put it more simply, the original assumption that
> frequency shifting
>       > would be "the simplest method" was unfounded.
>       > Frequency shifting is actually quite complicated,
> subtle, error prone, and
>       > not so well defined.
>       >
>       > Dick
>       >
>
>
> Julius O. Smith III <jos@xxxxxxxxxxxxxxxxxx>
> Prof. of Music and Assoc. Prof. (by courtesy) of Electrical
> Engineering
> CCRMA, Stanford University
> http://ccrma.stanford.edu/~jos/ <http://ccrma.stanford.edu/~jos/>
>


Attachment: fs.png
Description: PNG image