> On March 8, 2020 2:00 PM Zhiguang Eric Zhang <zez...@nyu.edu> wrote:
> 
> it is not causal because the zero-phase system does not depend on past samples
> 
> 
> On Sun, Mar 8, 2020 at 1:58 PM Zhiguang Eric Zhang <zez...@nyu.edu> wrote:
> > the frequency response is a function of the windowing function
> > 
> > 

what frequency response, Eric?  if the only sample the "zero-phase system" 
depends on is the present sample, not past nor future samples, then the system 
is a wire or simply a scaler (if it's linear) or some other memoryless function 
if it's nonlinear.  we normally mean linear systems when we discuss "frequency 
response".

people here on this list are pretty competent about what linear system theory 
is, what makes systems linear or not, what makes them time-invariant or not, 
what makes for causal and acausal systems, what determines the frequency 
response of a linear system (it's the impulse response), what window functions 
are and their effect on the spectra of signals, what linear-phase systems are 
and what hypothetical zero-phase systems are.  this is all in textbooks.

one thing that needs to happen for anyone to truly assist anyone else here, is 
that communication is unambiguous and accurate.  that means we really have to 
agree on the definitions of terms.

an FIR filter is a linear, time-invariant system.  it can be a linear-phase 
system, but it doesn't have to be.  that depends on the IR, which is F.  if and 
only if the IR is symmetrical, it's linear-phase.  a linear-phase FIR can be 
modeled as a hypothetical zero-phase FIR (so only magnitude response is in its 
description) followed or preceded by a delay of 1/2 of the length of the FIR.  
the phase response of a delay is a linear function of frequency, hence "linear 
phase".  a hypothetical zero-phase filter is one with symmetry about the t=0 
axis of the impulse response.  that means that samples in the future of the IR 
are a mirror image of samples in the past.  add some delay and you can move all 
of the non-zero samples to the past (and one for the present input sample).

using the FFT (and iFFT and frequency-domain multiplication of the frequency 
response) is an operation we often call "fast convolution".  fast convolution 
is used for very long (but still finite) FIRs.  for short FIRs we just do it 
the simple way, a dot-product of the IR against the most recent input samples.  
fast convolution is performed using one of two techniques: "overlap-add" (OLA) 
and "overlap-scrap" (OLS).  the older lit will say "overlap-save" for OLS, but 
we mean the same thing.  

normally, the only windowing we do for fast convolution, is the rectangular 
window.  because of the overlapping and the linear-system nature of the 
operation, there are no windowing effects.  it *is* possible to do something 
like fast convolution FIR with overlap-add using a different window as long as 
it is complementary in the overlap (such as a Hann window), but it makes the 
operation less "fast".  if there is 50% overlap, the number of net output 
samples computed in each frame is 1/2 that for using rectangular given both 
windows having the same non-zero length, so it would be half as efficient.

lastly, this "overlap-add" method of fast convolution should not be confused 
with the overlap-add method of the STFT processing music DSP people often use 
for more general and sophisticated processing of audio (such as a phase 
vocoder).  generally more sophisticated than an FIR.  in that application, a 
rectangular window would be considered pretty bad.  but all this is not what 
"fast convolution" is, which we use to implement long FIR filters (like 
reverberators).

i'm just trying to be helpful, but none of us can really be helpful if we 
cannot at least agree on the terminology.

-- robert
 
r b-j                  r...@audioimagination.com
 
"Imagination is more important than knowledge."


> > On Sun, Mar 8, 2020 at 10:34 AM robert bristow-johnson 
> > <r...@audioimagination.com> wrote:
> > > 
> > >  
> > >  > On March 8, 2020 10:05 AM Ethan Duni <ethan.d...@gmail.com> wrote:
> > >  > 
> > >  > 
> > >  > It is physically impossible to build a causal, zero-phase system with 
> > > non-trivial frequency response.
> > >  
> > >  a system that operates in real time. when processing sound files you can 
> > > pretend that you're looking at some "future" samples. i guess that would 
> > > be acausal, so you're right, Ethan.
> > >  
> > >  --
> > >  
> > >  r b-j                  r...@audioimagination.com
> > >  
> > >  "Imagination is more important than knowledge."
> > >  
> > >  
> > >  > 
> > >  > > On Mar 7, 2020, at 7:42 PM, Zhiguang Eric Zhang <zez...@nyu.edu> 
> > > wrote:
> > >  > > 
> > >  > > Not to threadjack from Alan Wolfe, but the FFT EQ was responsive 
> > > written in C and running on a previous gen MacBook Pro from 2011. It 
> > > wouldn't have been usable in a DAW even without any UI. It was running 
> > > FFTW.
> > >  > > 
> > >  > > As far as linear / zero-phase, I didn't think about the impulse 
> > > response but what you might get are ripple artifacts from the FFT 
> > > windowing function. Otherwise the algorithm is inherently zero-phase.
> > >  > > 
> > >  > > 
> > >  > > On Sat, Mar 7, 2020, 7:11 PM robert bristow-johnson 
> > > <r...@audioimagination.com> wrote:
> > >  > > > 
> > >  > > > 
> > >  > > > > On March 7, 2020 6:43 PM zhiguang zhang 
> > > <zhiguangezh...@gmail.com> wrote:
> > >  > > > > 
> > >  > > > > 
> > >  > > > > Yes, essentially you do have the inherent delay involving a 
> > > window of samples in addition to the compute time.
> > >  > > > 
> > >  > > > yes. but the compute time is really something to consider as a 
> > > binary decision of whether or not the process can be real time.
> > >  > > > 
> > >  > > > assuming your computer can process these samples real time, the 
> > > delay of double-buffering is *twice* the delay of a single buffer or 
> > > "window" (i would not use that term, i might use the term "sample block" 
> > > or "sample frame") of samples. suppose your buffer or sample block is, 
> > > say, 4096 samples. while you are computing your FFT (which is likely 
> > > bigger than 4K), multiplication in the frequency domain, inverse FFT and 
> > > overlap-adding or overlap-scrapping, you are inputting the 4096 samples 
> > > to be processed for your *next* sample frame and you are outputting the 
> > > 4096 samples of your *previous* sample frame. so the entire delay, due to 
> > > block processing, is two frame lengths, in this case, 8192 samples.
> > >  > > > 
> > >  > > > now if the processing time required to do the FFT, 
> > > frequency-domain multiplication, iFFT, and overlap-add/scrap exceeds the 
> > > time of one frame, then the process cannot be real time. but if the time 
> > > required to do all of that (including the overhead of interrupt I/O-ing 
> > > the samples in/out of the blocks) is less than that of a frame, the 
> > > process is or can be made into a real-time process and the throughput 
> > > delay is two frames.
> > >  > > > 
> > >  > > > > > On Sat, Mar 7, 2020, at 6:00 AM, Zhiguang Eric Zhang wrote:
> > >  > > > > > ... FFT filtering is essentially zero-phase ...
> > >  > > > 
> > >  > > > FFT filtering **can** be linear-phase (which is zero-phase plus a 
> > > constant delay) if the FIR filter impulse response is designed to be 
> > > linear-phase (or symmetrical). it doesn't have to be linear phase.
> > >  > > > 
> > >  > > > --
> > >  > > > 
> > >  > > > r b-j                  r...@audioimagination.com
> > >  > > > 
> > >  > > > "Imagination is more important than knowledge."
> > >  > > > 
> > >  > > > > On Sat, Mar 7, 2020, 5:40 PM Spencer Russell 
> > > <s...@media.mit.edu> wrote:
> > >  > > > > > On Sat, Mar 7, 2020, at 6:00 AM, Zhiguang Eric Zhang wrote:
> > >  > > > > > > Traditional FIR/IIR filtering is ubiquitous but actually 
> > > does suffer from drawbacks such as phase distortion and the inherent 
> > > delay involved. FFT filtering is essentially zero-phase, but instead of 
> > > delays due to samples, you get delays due to FFT computational complexity 
> > > instead.
> > >  > > > > > 
> > >  > > > > > I wouldn’t say the delay when using FFT processing is due to 
> > > computational complexity fundamentally. Compute affects your max 
> > > throughput more than your latency. In other words, if you had an 
> > > infinitely-fast computer you would still have to deal with latency. The 
> > > issue is just that you need at least 1 block of input before you can do 
> > > anything. It’s the same thing as with FIR filters, they need to be causal 
> > > so they can’t be zero-phase. In fact you could interchange the FFT 
> > > processing with a bank of FIR band pass filters that you sample from 
> > > whenever you want to get your DFT frame. (that’s basically just a 
> > > restatement of what I said before about the STFT.)
_______________________________________________
dupswapdrop: music-dsp mailing list
music-dsp@music.columbia.edu
https://lists.columbia.edu/mailman/listinfo/music-dsp

Reply via email to