Build your own noise shaping filters!, Freeware inside 
Build your own noise shaping filters!, Freeware inside 
Sep 4 2006, 09:55
Post
#1


Group: Developer Posts: 1318 Joined: 20March 04 From: Göttingen (DE) Member No.: 12875 
Hi!
Inspired by this thread  but also because I like messing around with DSP stuff from time to time .... I wrote two programs that let you design and apply noise shaping filters. Check out my little homepage (screenshot and ZIP to downlad). I'm kind of proud of the way poles and zeros are controlled. Havn't seen this approach before. Also, you get to hear the result instantly. Try altering the response while audio is on Cheers! Sebastian PS: I should probably mention that the noise you hear (program "iiirdsgn") is TPDF dithered silence. PPS: It's likely that you can design better noise shaping filters than those that are supplied. I didn't have accurate equal loudness data available. Filter design tips:  Try to keep the number of red and blue strings minimal  Keep the response below ... say +30 dB  Don't try to approximate equal loudness curves below, say, 1 kHz. If you do, the filters only get more complicated. There's hardly a gain due to the small bandwidth of that region. I intentionally use a linear frequency axis, so don't bother approximation the curves for a very small region. You may link to *.sos files you created if you think you've designed a really good one. This post has been edited by SebastianG: Sep 4 2006, 12:57 


Sep 5 2006, 13:19
Post
#2


Group: Developer Posts: 1318 Joined: 20March 04 From: Göttingen (DE) Member No.: 12875 
Those questions could be stupid, but.. What does the moving bar actually show? It indicates the maximum sample value you got for the last second. Dithering and noise shaping especially at low resolutions may lead to large fluctuations of samples even in case you might not hear it (because it may be mainly high frequency noise). Does it make sense to make a filter at 8 bit to use it at a higher bitrate? (well at least it works..) Yes. In fact this is what I did to design the filters 'cause the noise is easily noticable at lower resolutions. If you use the same filter with a higher resolution the noise floor just gets lowered  it still has the same "colour" to you (if you can hear it). How to understand this Zplanething? A pointer to some ressources would be nice. Sorry, I'm no good at giving pointers on this subject. Maybe someone can comment on some good DSP books. IIRC there was a "good DSP/digital audio books" thread in the R&D sub forum (or something like that). <technical mumbo jumbo> A point in the ZPlane basically corresponds to an oscillating signal with either decreasing amplitude (inside the circle), constant amplitude (on the circle) or increasing amplitude (outside the circle) and of a certain frequency that's given by the argument of the point (as complex number). The filter transfer function just tells you what the filter is doing to said oscillating signals. If you care about what it does to constant amplitude sinusoids you just evaluate this function on the circle (which is how the green curve is derived). The zeros (blue circles) and poles (red crosses) are defining that transfer function as a rational polynomial with the zeros as roots of the nominator and poles as roots of the denominator. This should also explain why those things have the greatest impact on the response if they're close to the unit circle. The number that gets showed for each root in the frequency response plot is the distance of the root from the origin. I'm afraid I possibly havn't achieved anything by saying it with my own words in such a compact way. You better grab a good DSP book to look at. </technical mumbo jumbo> In the transfer function, is z^{x} representing the signal or the quantization error. I'd think that it should be the quantization error, as noise shaping is supposed to be a filter on quantization error, however the presence of z^{0} is then puzzling me. It's just a transfer function corresponding to an IIR filter. This IIR filter is applied to the unshaped noise. The presence of z^0 is not a problem really, z^0 = 1  although it takes a while to understand how filtering can be applied to the noise only. (Well, at least it took me quite a while to realize). <technical info> Recall the "difference IIR" formula: y_{n} = b_0 * x_{n} + b_1 * x_{n1} + b_2 * x_{n2} + ...  a_1 * y_{n1}  a_2 * y_{n2}  a_3 * y_{n3} where y is the filter's output, x is the filter's input, the index n refers to the current sample, n1 refers to the previous sample a.s.o. and b's and a's are the filter's coefficients. In case of noise shaping filters b_0 needs to be equal to ONE so that output and input are related in the following way: y_{n} = x_{n} + OutputInputDifference(n) where OutputInputDifference(n) ist just an abbreviation of the sum given above and depends on the filter's coefficients and past (un)filtered samples. The funny thing about noise shaping is: You're computing the current sample without knowing x_{n} before because x_{n} will be the quantization error. Suppose s_{n} are the samples of the actual signal you want to transport and x,y are the samples of the (un)filtered noise. What actually happens in the inner loop over n is: 1) wanted_{n} = s_{n} + OutputInputDifference(n) 2) quantized_{n} = quantize( wanted_{n} + dither() ) 3) y_{n} = quantized_{n}  s_{n} 4) x_{n} = y_{n}  OutputInputDifference(n) // == quantized_{n}  wanted_{n}, the actual error I recently checked Why 1Bit Delta Conversion is Unsuitable for HighQuality Applications again. Their noise shaper's transfer function is given by 1H(z) which also corresponds to a rational polynomial of the form (1+b1*z^{1}+b2*z^{2}+...)/(1+a1*z^{1}+a2*z^{2}+...) like printed by IIIRDSGN. And any such rational polynomial can be represented as 1+polynomial_division_residual. In the end it's all the same. </technical info> Cheers! This post has been edited by SebastianG: Feb 2 2007, 20:06 


LoFi Version  Time is now: 7th October 2015  12:09 