Somehow, we are talking about different things maybe? In what I'm talking about, the key is that "n" is not integer, for most practical filters used for this purpose.
Robert, when I said "only for half-band", I was talking about specific case, not general (in the context of the earlier discussion--or at least how I remembered it--I thought at some point you mentioned every-other sample, but maybe not). I considered stopping and rewording it for the general case, but I really didn't have the time. If it's quarter-band, you have a zero every four coefficients (and you get to skip one-fourth of the calculations); third-band, every three (and you get to skip one-third of the calculations), etc. If it's for sample rate conversion and you're using windowed-sinc, you are probably using a factor of two as much as possible, three if necessary, if you're trying to take advantage of the zeros in a multirate system. That's why I limited my comments to half-band. But if it's not an integer, you don't have the zeros, and can't copy the original samples. And in the general case, using a windowed sinc filter to oversample or resample at an integer ratio, you don't use an integer ratio on the filter. Am I saying something wrong here? Let's talk about 2x, to keep it simple--this is also that ratio that gives you the biggest efficiency gain. So, you might use this filter when resampling to half the current sample rate. Say we have an 88.2 kHz file we want to resample to 44.1 kHz. If you set your filter to half of Nyquist--22050 Hz in the case--every other sample is zero. But you're only down 6 dB at that point--you *will* have aliasing (assuming you recorded something that had frequency components just above 22050 Hz--the general case). You can minimize it by using a longer filter, but it will alias--just not extend as far into the band of interest before hitting the stop level. OTOH, you can move the filter corner down fractionally, dropping the 6 dB point to, say, 20000 Hz, and get aliasing rolled off to an arbitrary target (say, -90 dB, -120 dB, whatever) by the new Nyquist frequency (22050 Hz). But you will not have a zero every other sample, and you can not just copy the original samples. Make sense? On Dec 23, 2010, at 10:18 AM, robert bristow-johnson wrote: > > On Dec 23, 2010, at 12:46 PM, Nigel Redmon wrote: > >> On Dec 21, 2010, at 8:36 PM, robert bristow-johnson wrote: >>> and trying to point to an obvious advantage to any windowed sinc (that you >>> don't have to compute the FIR when the output same lands squarely on top of >>> an input sample when all you need to do is copy the sample)... >> >> Not sure if you caught my earlier comment, Robert, but what you say here is >> only true of half-band filters. > > no, it's true for *any* windowed-sinc polyphase FIR resampler. and it's true > because sinc(n)=0 for any integer n<>0. > > it has nothing to do with half-band symmetry, but in the case where you're > upsampling by 2, you *will* get half-band symmetry and then it's every other > output sample that has zero FIR coefficients (except for a single coef that > is 1). > > but consider the use of a windowed-sinc kernel where you are upsampling by a > factor of 4, then one out of 4 of the output samples may be merely copied, > but the other 3 of 4 must go through the FIR calculation with non-zero (and > non-unity) coefficients. > >> (If I understand what you're saying correctly?) That is, if you don't want >> significant aliasing in the general case, your filter has to be set a bit >> lower, and in that case it's filtering those original points, so you can't >> just copy them. > > the general issue of aliasing has to do with the design of the FIR low-pass > impulse response or kernel. some designs are better than others for > satisfying the specs. if you do not require your interpolated signal to go > through the original sample points, then you need not restrict yourself to a > windowed-sinc kernel and can do better with Parks-McClellan or Least Squares > design of the FIR low-pass kernel. but then you lose that one little > advantage of a window-sinc that when the interpolated output lands precisely > on the input sample, that you just copy the input sample. that advantage > counts for something when upsampling by 2 because then it is every other > output sample that *does* land directly on top of an input sample. you gain > a 50% computational savings by just copying that input sample over. > > BTW, because Lagrange or Hermite polynomial interpolation also goes directly > through each of the input sample points (just as windowed-sinc does), you can > take the implied impulse response and divide that by the sinc() function > (dealing with the 0/0 limit as a "removable singularity") and come up with an > implied window. so, in a sense, Lagrange or Hermite polynomial-based > interpolation is a form of windowed-sinc, it's just that you don't know > exactly what the window is, in advance. > > -- > > r b-j [email protected] > > "Imagination is more important than knowledge." -- dupswapdrop -- the music-dsp mailing list and website: subscription info, FAQ, source code archive, list archive, book reviews, dsp links http://music.columbia.edu/cmc/music-dsp http://music.columbia.edu/mailman/listinfo/music-dsp
