[prev in list] [next in list] [prev in thread] [next in thread] 

List:       sox-devel
Subject:    Re: [SoX-devel] Merge Request to add 192kHz support for RIAA effect
From:       Eric Wong <normalperson () yhbt ! net>
Date:       2018-08-04 1:53:11
Message-ID: 20180804015311.52i2c3qxhnh5hd2n () dcvr
[Download RAW message or body]

Sonny Ray <sonnyray@gmail.com> wrote:
> I don't know how merge request notifications work on SourceForge; if this
> is spammy, apologies.

I didn't even know that was a thing on SF.  Anyways I prefer all
messaging be done via email so we can still message each other
in case the centralized system bites the dust.

> Maintainers, please check out this Merge Request that adds 192kHz support
> to the RIAA biquad EQ effect using poles/zeros from a trusted source.
> 
> https://sourceforge.net/p/sox/code/merge-requests/5

Since I don't use JavaScript, I had to read the HTML source to
figure out how to get the code from your git repo via fetch.
So I added the following 3 lines to my .git/config and fetched it
via "git fetch rayrrr"

	[remote "rayrrr"]
		url = https://git.code.sf.net/u/rayrrr/sox
		fetch = refs/heads/*:refs/remotes/rayrrr/*

And your change appears to be:

commit 12b80e89e6a5928cb5f715895d5950dfbac11e53
Author: Ray <7869818+rayrrr@users.noreply.github.com>
Date:   Wed Aug 1 23:45:59 2018 -0400

    Add 192k sample rate support to RIAA biquad effect.

diff --git a/src/biquads.c b/src/biquads.c
index 29440a7a..b30fee97 100644
--- a/src/biquads.c
+++ b/src/biquads.c
@@ -340,7 +340,8 @@ static int start(sox_effect_t * effp)
       p->a2 = 1 - sin(w0);
       break;
 
-    case filter_riaa: /* http://www.dsprelated.com/showmessage/73300/3.php */
+    case filter_riaa:
+      /* https://www.dsprelated.com/showmessage/73300/3.php */
       if (effp->in_signal.rate == 44100) {
         static const double zeros[] = {-0.2014898, 0.9233820};
         static const double poles[] = {0.7083149, 0.9924091};
@@ -359,14 +360,21 @@ static int start(sox_effect_t * effp)
         make_poly_from_roots(zeros, (size_t)2, &p->b0);
         make_poly_from_roots(poles, (size_t)2, &p->a0);
       }
+      /* https://diyaudio.com/forums/analogue-source/203706-error-self-riaa-5.html#post2865323 */
       else if (effp->in_signal.rate == 96000) {
         static const double zeros[] = {-0.1141486, 0.9676817};
         static const double poles[] = {0.8699137, 0.9966946};
         make_poly_from_roots(zeros, (size_t)2, &p->b0);
         make_poly_from_roots(poles, (size_t)2, &p->a0);
       }
+      else if (effp->in_signal.rate == 192000) {
+        static const double zeros[] = {-.1040610965, 0.9837523263};
+        static const double poles[] = {0.9328992971, 0.9983633125};
+        make_poly_from_roots(zeros, (size_t)2, &p->b0);
+        make_poly_from_roots(poles, (size_t)2, &p->a0);
+      }
       else {
-        lsx_fail("Sample rate must be 44.1k, 48k, 88.2k, or 96k");
+        lsx_fail("Sample rate must be 44.1k, 48k, 88.2k, 96k, or 192k");
         return SOX_EOF;
       }
       { /* Normalise to 0dB at 1kHz (Thanks to Glenn Davis) */


Which all seems fine based on what I can infer from surrounding
code (haven't tested).  Thanks.

I'll let Mans deal with taking it upstream.

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
SoX-devel mailing list
SoX-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sox-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic