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: 1317
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
Gabriel
post Sep 29 2006, 16:12
Post #2


LAME developer


Group: Developer
Posts: 2950
Joined: 1-October 01
From: Nanterre, France
Member No.: 138



For the beginners, here is an intro to the zeros/poles stuff in z-plane:
http://www.eumus.edu.uy/docentes/jure/docs...eBraindead.html
Go to the top of the page
+Quote Post
SebastianG
post Mar 5 2008, 11:03
Post #3





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



I just thought you might be interested in a filter that I computed some time ago for 44kHz. This is what I did:
  • used LAME's ATH-curve formula (high quality setting)
  • clipped the magnitude response below 200 Hz and above 18 kHz (so the max gain is limited to +20 dB)
  • ran a non-linear least squares fitter that minimized the log magnitude errors to get a 4th order IIR filter close to LAME's ATH curve.
Here's the result:

CODE
SOS FILE VERSION 1
size = 2x6
   1.0   0.43661   0.43995   1.0   1.21968   0.67167
   1.0  -1.58404   0.78993   1.0  -0.16099  -0.40768
# newly designed filter according to LAME's ATH curve
# for a sampling frequency of 44100 Hz
# max gain (limited) : +20 dB at 18-22 kHz
# min gain           : -23 dB at 3400 Hz

Save the above text to "lameath44.sos" and the filter is ready to be used by REQUANT.

Note: This filter is NOT compatible to IIIRDSGN. It has a pair of distinct real poles and IIIRDSGN only supports complex conjugate roots. IIIRDSGN will simply ignore 2nd order polynomials with distinct real roots, print out a warning and show you a different magnitude response.

This given 2x6 matrix is in fact a MATLAB compatible second-order-section matrix. The corresponding numerator and denominator coefficients are [b,a]=sos2tf(sos_matrix):
b = [1.0000 -1.1474 0.5383 -0.3520 0.3475]; % the numerator
a = [1.0000 1.0587 0.0676 -0.6054 -0.2738]; % the denominator

edit:
In case your noise shaping implementation follows this popular signal flow graph and you require the coefficients b_h & a_h for H(z) then you need to derive these from the noise shaper's transfer function G(z) (given by b & a) like this:
b_h = remove_leading_zero(a-b);
a_h = a;
due to the relationship G(z) = 1 - z^-1 H(z). So, for the above example b_h would be
b_h = [2.20610 -0.47070 -0.25340 -0.62130];
For FIR filters this boils down to removing the leading one and negating the remaining coefficients.

Cheers,
SG

This post has been edited by SebastianG: Mar 10 2008, 17:37
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: 20th August 2014 - 16:22