IPB

Welcome Guest ( Log In | Register )

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





Group: Developer
Posts: 1318
Joined: 20-March 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. smile.gif
Also, you get to hear the result instantly. Try altering the response while audio is on wink.gif

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. wink.gif

This post has been edited by SebastianG: Sep 4 2006, 12:57
Go to the top of the page
+Quote Post
 
Start new topic
Replies
SebastianG
post Sep 5 2006, 13:19
Post #2





Group: Developer
Posts: 1318
Joined: 20-March 04
From: Göttingen (DE)
Member No.: 12875



QUOTE (Hollunder @ Sep 5 2006, 11:59) *
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).

QUOTE (Hollunder @ Sep 5 2006, 11:59) *
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).

QUOTE (Hollunder @ Sep 5 2006, 11:59) *
How to understand this Z-plane-thing? 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 Z-Plane 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>

QUOTE (Gabriel @ Sep 5 2006, 12:49) *
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 wink.gif -- 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_{n-1} + b_2 * x_{n-2} + ... - a_1 * y_{n-1} - a_2 * y_{n-2} - a_3 * y_{n-3}
where y is the filter's output, x is the filter's input, the index n refers to the current sample, n-1 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 1-Bit Delta Conversion is Unsuitable for High-Quality Applications again. Their noise shaper's transfer function is given by 1-H(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
Go to the top of the page
+Quote Post

Posts in this topic
- SebastianG   Build your own noise shaping filters!   Sep 4 2006, 09:55
- - Ken S   QUOTE (SebastianG @ Sep 4 2006, 09:55) I...   Sep 4 2006, 19:18
|- - d_headshot   QUOTE (Ken S @ Sep 4 2006, 13:18) QUOTE (...   Jun 24 2011, 23:08
- - Firon   It seems to have clicking noises while typing or c...   Sep 4 2006, 21:43
- - bhoar   QUOTE (SebastianG @ Sep 4 2006, 04:55) Hi...   Sep 5 2006, 07:32
- - SebastianG   QUOTE (Ken S @ Sep 4 2006, 20:18) Very ve...   Sep 5 2006, 09:48
|- - bhoar   QUOTE (SebastianG @ Sep 5 2006, 04:48) QU...   Sep 5 2006, 14:30
- - cabbagerat   Nice tool, thanks.   Sep 5 2006, 10:47
- - Hollunder   link works here too Those questions could be stup...   Sep 5 2006, 10:59
- - Firon   QUOTE (SebastianG @ Sep 5 2006, 04:48) I...   Sep 5 2006, 11:41
- - Gabriel   Dummy question: In the transfert function, is z^{x...   Sep 5 2006, 11:49
- - SebastianG   QUOTE (Hollunder @ Sep 5 2006, 11:59) Tho...   Sep 5 2006, 13:19
- - Hollunder   Thank you sebastian, I found the thread you mentio...   Sep 5 2006, 16:04
- - Gabriel   For the beginners, here is an intro to the zeros/p...   Sep 29 2006, 16:12
|- - SebastianG   I just thought you might be interested in a filter...   Mar 5 2008, 11:03
|- - SebastianG   For those who are interested in using these filter...   Mar 7 2008, 18:31
- - neelX   QUOTE (SebastianG @ Sep 4 2006, 10:55) .....   Jan 16 2010, 14:33
- - lvqcl   CODE This package is FREEWARE. You are allowed to ...   Jan 16 2010, 15:24
|- - neelX   thank you lvqcl   Jan 16 2010, 23:29
- - chjmartin2   I realize that this thread is relatively old, but ...   Jun 24 2011, 14:21
|- - Canar   QUOTE (chjmartin2 @ Jun 24 2011, 06:21) M...   Jun 25 2011, 01:32
- - zhuzengyou   HellO: The demo code is out of data,is any ...   May 13 2012, 03:35
- - dindisalvadi   Hi i'd like to do a filter for 96 kHz, can any...   Nov 27 2013, 19:37


Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 28th August 2014 - 04:26