robert bristow-johnson <rbj@surfglobal.net> wrote in message news:BC31AF92.7DC0%rbj@surfglobal.net...> In article bufn81$h6vvj$1@ID-210375.news.uni-berlin.de, Jon Harris at > goldentully@hotmail.com wrote on 01/18/2004 23:45: > > > Ronald H. Nicholson Jr. <rhn@mauve.rahul.net> wrote in message > > news:bufdfe$f3d$1@blue.rahul.net... > ... > one place where that is useful is in designing the FIR coefs to start with > if the upsample ratio is so high that MATLAB's remez() chokes on it. so you > do it for fewer phases, and then use those very coefs to interpolate a > denser table with more phases. > > > This is usually overkill. Unless your available table memory is so smallthat> > you can only store a handfull of phases, the filter coefficients are > > essentially highly oversampled data (or low pass data as r b-j called it). > > it's not what i meant regarding "low pass data", Jon. hmmmm. maybe it *is* > what i meant, but from a different POV. > > what i meant is if the audio data is highly oversampled (which lot's of > phases in the FIR table would do to it), then it appears, from the POV of > the high sampling rate, very "low pass data". now if that's the case, the > *images* are narrow little blips at every integer multiple of the high Fs > and a sinc^2 frequency response (which is what you get when you convolute > with the triangular pulse which is what happens when you do linear > interpolation between neighboring samples which is essentially the same > thing you are doing if you are interpolating between coefficients of > neighboring phases) will kill those little blips quite nicely. higher order > B-splines (which has frequency response of sinc^(N-1) for an Nth order > B-spline) will kill those blips even better.A big AHA! for me a while back was that interpolating between the coefficients and then using them to interpolate the audio is the same as calculating several results using the "stright" coefficients and then interpolating between them to get the final result. (I know I'm not saying that very clearly, but hopefully you know what I'm trying to get at.) If you look at the math, it's pretty clear that they are equivalent, but it wasn't intuitively obvious to me. Either way, the data is "low pass", it's just that in one case the audio is low-pass while in the other case the coefficients (phases) are low pass.> > Hence you can get away a pretty simple interpolation scheme since there > > is very little high-frequency content. > > > >> Hmmm... I wonder how many levels of this it takes before diminishing > >> returns sets in? Everybody seems to assume 1.5 levels in enough: > >> 1 or 2 taps (select or linear interpolation inside the phase table > >> for the FIR coefficients) plus N taps (for the data). > > > > This is usually adequate for the reasons stated above (and see below too). > > if you have 512 different phases of your polyphase FIR filter (the same as > oversampling by a factor of 512), then linear interpolation will be adequate > for an S/N of 120 dB, if i recall correctly. if you do a cubic B-spline, > you will need only 16 or 32 different phases (or oversampling by 16 or 32) > to get the same S/N. if you're doing *no* interpolation (sometimes called > "drop-sample") between coefficients (or oversampled samples), then you need > 512K phases (or oversample by 512K.Sounds reasonable. I know those early Analog Devices chips used linear coef. interpolation and got 120dB. I read in a paper once how many phases they kept, but don't remember anymore.> >> Given a fixed number of MACs per sample and a fixed number of table > >> entries (to fit in x% of the dcache for instance), it looks like there > >> are several possiblities. 0 MACs for the coeffs and N MACs for the data. > >> N/2 MACs for 2 taps of coeff generation (and with a table now with twice > >> as many phases in the same number of bytes) and N/2 taps for the data. > >> Or maybe even more MACs for coefficient generation and an even shorter > >> FIR filter. An interesting optimization and error bounding problem. > > > > I think it would usually be pretty easy to find the optimial answer. For > > example, if you decide to do linear coeficient interpolation, youimmediately> > have to use a shorter filter which means you can store more phases in thesame> > memory, which means there is a less critical need for the linear coef > > interpolation. You can see why higher order interpolation of the coefs > > quickly becomes a losing battle. The only excpeption might be if memory was > > *extremely* tight and you had tons of MACs available. > > now, if you are *upsampling*, then you can do the linear (or whatever kind) > interpolation on the resulting output samples from the two (or more) > neighboring phases. that is mathematically equivalent to interpolating the > coefficients and usually much simpler to code.Regarding which method is best, if you need to do the same interpolation on more than one data stream (e.g. stereo audio), then you're better off doing the linear (or whatever kind) of interpolation on the coefs and then applying the results to all the audio channels. Otherwise, like you said, it's equivalent, so pick the simplest method.> <snip>