Re: fir allpass filters for phase-alignment



Hi Robert,

I think, you (and Fred as well) understand the basic idea.
But now we are discussing all kinds of issues with ideas
_similar_ to what I want to do, which is great, but still I feel
like I have to clearify, that I try to solve a very specific
problem (creating phase-aligning fir filters) that I need
for the scheme that I am using.



robert bristow-johnson wrote:
On Dec 11, 2:43=A0pm, "banton" <bant...@xxxxxx> wrote:
Fred wrote:
...
The challenge seems to be to find an appropriate delay. What if
you did a
short-term correlation between the signals to find a likely splice
point?

or Average Magnitude Difference Function (AMDF) or Squared difference
(ASDF).

I am already doing that to localize the splice points.
The allpass filtering comes afterwards to do phase correction.

phase correction of *what*?? phase and delay, while not exactly the
same concept, are almost the same thing. at least they are not
independent.if i do not misunderstand you, you have already adjusted
the phase to get the least amount of "glitch" in the splice. now, if
due to non-periodicity, you want to adjust the phases of different
sinusoidal components independently, you need to do either a multiband
"time-domain" splicing scheme, or something like the phase vocoder to
lose the glitches in the non-periodic portions.

Ok, a multiband method, pvoc etc..
Of course this things come to mind, and I have tried stuff in
this direction, but right now I am trying something different.
And actually it does allready kind of work, I am trying to
improve it. It's a time-domain scheme that first finds good
correlations to qualify possible jump-points and additionaly
applies a filter which smoothes out the transition.
Believe me, it works and makes sense, I could show you
some plots (I'd need to find a way to put them somewhere on the web)
that show the regions around the transition points and how
the correlation increases by applying the phase-aligning filters.


the "blurred spectra and other artifacts" that come from the p-voc is
due to the fact that, in an inharmonic sound, no single amount of
delay lag will perfectly match for all frequency components. but for
harmonic (or "quasi-periodic") sounds, the cross-correlation or AMDF
*will* find a lag that *does* make all harmonics happy. the amount of
phase shift that this results for the 2nd harmonic is exactly twice
that of the 1st. for each harmonic, in a time-scaling application,
you are splice in or out an integer number (call it M) of cycles of
your periodic waveform. so, for the first harmonic, you are splicing
in or out M sinusoidal cycles. for the 2nd harmonic it's 2M, for the
3rd it's 3M and so on.

Mmh... p-vocs and spectral modells are in my definition all
kind of techniques that decompose the input into time-varying
sinusoids with associated frequency and amplitude curves.
The reconstruction is an oscillator bank.
The analysis as well as the synthesis can be implemented in
numerous different ways (heterodyning, framewise amplitude peak
estimation, delta phase between frames etc....)
Some of the method do not use any notion of frames (e.g. heterodyning)
and such methods care little or nothing, if the input is harmonic or
not. I think the artefacts are rather due to components which are
too close together, noise, transients and just anything that
is hardly described as mixture of timevariable sinusoids.
How this related to the question whether the
components are harmonic or inharmonic is unclear to me.


the p-voc method gets *all* sinusoidal components spliced in phase (by
disassembling the sound into individual sinusoidal components), but at
the expense of sacrificing waveshape since some sinusoidal components
are delayed a different amount of time than others to accomplish
glitch-free splicing for all.


I don't care if the waveshape looks the same, but I would
rather say: at the expense of mushing up the signal due to
properties of the input that do not fit to the modell and
due to problems with unsharp analysis procedures.
Obviously phase shifts change the waveshape as well, but
it's a less drastic manipulation, compared to the notion
that a sound consists of a bunch of modulated sine oscillators.

Even though it is not my original goal (which is simply to synthesize
interesting sounds with experimental methods), I'll pretend from > now
on that the goal of what I am doing is to time-stretch chords.

major chords will sound good. minor chords less good. diminished
chords will sound bad.


Robert, are you joking here?
A major chord consists of 1 ,5/4, 3/2 ratios in natural tuning,
of 1, 2^(4/12), 2^(7/12) in tempered tuning and some proportions
deviating around those ratios in praxis.
But if you don't like diminished chords in general, you
are right of course.

...
well, first of all, other than simple delays (or less simple
fractional-sample delays), you can't do a general APF with an FIR
because, while you can put your zeros wherever you like in an FIR, the
poles of an FIR remain at the origin. a general (non-pure delay) APF
has the poles and zeros mirrored (as reciprocals) about the unit
circle.

Ok, When I wrote allpass filter I simply mean any filter with
magnitude response 1 (or approx. 1) at all freqs.
Wouldn't you call a hilbert transformer an allpass?
Maybe, I used the term "allpass" a bit sloppy, I simply mean
any filter that shifts phases but as no effect (or approx)
on the magnitudes.

i think i understand what you want to do. some sorta Acid or similar
or an async granular synthesis thingie.

You might call it that. Async granular synthesis sound more
like the grain durations and boundaries are not dependent
on the input signal and in this case they are dependent.
I might call it wave-jumping.

the best i can recommend is
jitter your segment locations a little to get the best match for
splicing. another thing is to use splicing functions that can
gracefully vary between "constant-voltage" crossfades (for splicing
completely correlated sound segments) to "constant-power" crossfades
(for splicing completely uncorrelated sound segments). this is what i
was thinking about back in 1998 when i posted this:

http://groups.google.com/group/comp.dsp/browse_frm/thread/b332e8223828f222/=
befae9679b77ec96


Thanks for the link, I will take a close look at this!

Thanks for all the suggestions, it was very interesting.
But I'll show you a stretched diminished chord that doesn't
sound bad soon;)
And still I am trying to get some way to do this:

===================================================================

Given two signals x and y,
find allpass response h (of a given size)
so that convolving h with y
will minimize the sum of the phase differences (modular in 2*pi) between
X = FFT(x[n] ... x[n+k]) and
Y = FFT(y[n] ... y[n+k])
where n (the position of FFT frames) and k (the size of the FFT frames)
are given.

It could look like the answer is trivial:
Just create the spectrum H with constant magnitude 1.0 and
phase values angle(X) - angle(Y), after multiplication
of Y with H the phase values are equal, but this is
not the best response, for the problem stated above, since this
approach is based on circular convolution of the two frames, while
I want to convolve y (the whole signal, not just the given frame)
with h. The best solution has to be dependent on the samples
in frame X plus samples x[n-m] where m is the length of the response.

========================================================================

anybody?

thanks,
Bjoern




_____________________________________
Do you know a company who employs DSP engineers?
Is it already listed at http://dsprelated.com/employers.php ?
.



Relevant Pages

  • Re: Oscars sync?
    ... but the network is doing a lousy job of maintaining sync. ... Further viewing seemed to confirm that video lagged audio almost all ... Feeding pictures by satellite and sound by land line hasn't really happened since some international feeds in the late sixties and early/mid seventies. ... As people have said, if the sound is early by a few frames, it's almost certainly because of digital video processing being used without associated audio delays. ...
    (rec.audio.pro)
  • Re: Why SR? (was: Source Independency of Light Speed Without an Aether???????)
    ... Similar to when you move away from a sound ... to have the laws of physics work in all inertial frames you end up ... physicists changed the nature of physics and declared that a physics ... at different speeds. ...
    (sci.physics.relativity)
  • Re: Is a custom frame for racing always an "upgrade"?
    ... But chances are the prewar Martin will sound every bit of all ... BTW, this tandem was a custom, built many years ago. ... Several people in my cohort have road bikes with CF frames made by ...
    (rec.bicycles.tech)
  • Re: TV picture loses frames/Sound drop out when 20 sec left of son
    ... A 7800 card should not drop frames even if processing 1080i HD TV programs. ... It may be the drivers for you audio card that are causing dropped frames ... Thanks for the answer - after I disabled all the enhancements, the sound ...
    (microsoft.public.windows.mediacenter)
  • Re: Is there a simple way of adding continuous background music?
    ... If using "target links" which open in a new window, to turn the sound ... Launch a popup window which plays the sound, ... Frames will work, but it breaks ...
    (uk.net.web.authoring)