ZolaIII
Major Contributor
- Joined
- Jul 28, 2019
- Messages
- 4,223
- Likes
- 2,496
IEEE 754 - Wikipedia
en.m.wikipedia.org
Last edited:
Yes, you are right; I didn't think it through properly. Any (FIR) filter where every Nth coefficient is zero will indeed preserve the input samples when used as an interpolation filter for upsampling by a factor N. The attenuation below the cut-off frequency is exactly matched by the imaging above.You don't need an ideal one, any windowed sinc preserve input samples.
This property is particularly important for half band filter ( for x2 upsampler) : you only need to compute half of the output samples, the other half are just the input samples.
You don't need an ideal one, any windowed sinc preserve input samples.
In case there was any doubt, nothing in that post makes any sense.You just made Rob Watts spit out his afternoon cup of tea
Hugo TT 2 by Chord Electronics - The Official Thread
I understand this sentiment completely. If it wasn't for Covid lockdown still in my area I would probably revert to my DAP, iem and a few good tunes. I can totally relate to that! Mine is covered with dust:gs1000smile:.www.head-fi.org
(I'm not really an expert in the area, so take with a grain of salt)
One rather inefficient way of upsampling with non-integer ratios is:
- reduce the ratio: 96'000 / 44'100 -> 320 / 147
- upsample by inserting 319 zeros between the samples - so far the original samples are preserved. The resulting sample rate is 14'112'000 (this is the Least Common Multiple of 44'100 and 96'000)
- apply filtering
- downsample by picking every 147th sample - most of the original samples are lost. The resulting sample rate is 96'000
I thought it was rather clear from the post that it is just curiosity.
So, we meet again
sox -r48k -n -b24 A_48.wav synth 60 pink norm -3 sinc -20k norm -3 fade 1 0 1
sox A_48.wav B_96.wav rate -v 96k
sox B_96.wav -r48k C_48.wav downsample 2
sox -m -v 1 A_48.wav -v -1 C_48.wav D_null.wav
sox D_null.wav -n stats 2>&1 | grep "Pk lev dB"
]$ for i in $(seq 10); do ./run.sh ; done
Pk lev dB -120.41
Pk lev dB -122.91
Pk lev dB -122.91
Pk lev dB -121.57
Pk lev dB -121.57
Pk lev dB -120.41
Pk lev dB -118.47
Pk lev dB -118.47
Pk lev dB -124.49
Pk lev dB -122.91
Now we take the same truncated sinc functions and apply a Kaiser window (β = 8):
In case anyone wants to experiment with how well the original samples are preserved when doing integer ratios:
Gee, now I'm wondering if I'm misunderstanding, after mansr changed his mind and you said this, so I'm risking a bout of hoof in mouth, but...You don't need an ideal one, any windowed sinc preserve input samples.
This property is particularly important for half band filter ( for x2 upsampler) : you only need to compute half of the output samples, the other half are just the input samples.
this ^^^^In case there was any doubt, nothing in that post makes any sense.
You perfectly understandGee, now I'm wondering if I'm misunderstanding, after mansr changed his mind and you said this, so I'm risking a bout of hoof in mouth, but...
First, when you say "any windowed sinc preserve input samples"...it seems "windowed" doesn't matter—we can't realize a non-windowed sinc filter (and if we could, it wouldn't change the assertion anyway). I'm not being nit-picky, just mentioning it in case it makes obvious that I'm misreading.
Any filter that have the property below will preserve input sample. But if you add the constrains : being low pass and symmetric , you will end up with a windowed sinc.mansr said:Any (FIR) filter where every Nth coefficient is zero will indeed preserve the input samples when used as an interpolation filter for upsampling by a factor N.
Yes, if for example, you design your filter with Parks–McClellan algorithm, it will have no chance to preserve input sample.Now, a half-band filter has zeros aligning with the sample periods, yes. But we often have the corner frequency below half. In that case, the zeros aren't aligned, we have lobes. That is, put 0..0,1,0..0 into such an upsampling filter, you don't get the same (with more zeros) out. The impulse response is not a lone 1 sample. So I would say input samples are not preserved (except in special cases like half-band). No?
Interesting, so WTA does not preserve input samples ...CHORD ELECTRONICS DAVE
I can't imagine Dave will replace my berkeley reference dac , if watts listen to my berkeley reference he will increase the taps to 400 K to beat it . Still I can't wait to hear it .www.head-fi.org
Yes, interest considering what he said before. (Not as many, um, questionable things in that post as before, but there he is again with his assertion that transients are moving around. I want to give him the benefit of the doubt, that I'm misunderstanding his point, but it's hard based on what he types—can anyone point me to a more detailed explanation of what he's going on about?)Interesting, so WTA does not preserve input samples ...
That's a really good answer. I just feel like peeling the onion back another layer, and say—for no other reason that nerdom...I don't have time to watch the video, but you don't keep the original samples in either case, given a fullrange signal, for any practical digital filter.
What is true is that upsampling by integer ratios involves way less math. To upsample by 2x for example, you just insert zeros between each sample and then apply a low-pass filter. This probably sounds strange and counter-intuitive if you're not used to signal processing, but after you're done filtering, the zeros get "magically" transformed into interpolated values. (Of course it isn't magic, it's just a beautiful result of how the math works.)
Because any practical low-pass filter has a transition band of nonzero width, some of the original samples may get changed during this process, if the input signal is fullrange.
When you upsample by non-integer ratios, the math is many times more complicated, and none of the original samples will be preserved (and of course they wouldn't -- where in the time domain would those samples be?).