sox-devel@lists.sourceforge.net unofficial mirror
 help / color / mirror / code / Atom feed
* Modification to spectrogram.c for log frequency axis and setting lower/upper chart frequency
@ 2014-02-17  0:21 Joe Desbonnet
  2014-02-17  6:14 ` Eric Wong
  0 siblings, 1 reply; 3+ messages in thread
From: Joe Desbonnet @ 2014-02-17  0:21 UTC (permalink / raw)
  To: sox-devel


[-- Attachment #1.1: Type: text/plain, Size: 1065 bytes --]

My modifications to spectrogram.c to plot frequency on log axis and also to
limit upper and lower plotted frequency are close to being complete.

I'm not very familiar with sox, and my C a bit rusty, so if any seasoned
sox developers have the time to review my code, that would be great.  The
log axis on its own didn't require much code change, but I found the
frequency limits needed a fair bit of new parsing code. Specifying
frequency limits (at least a lower bound) is necessary in log plots else a
good part of the screen will be wasted in frequencies 1 - 100 Hz which is
not the most useful for audio.

I've documented the changes at this blog post:
http://jdesbonnet.blogspot.ie/2014/02/sox-spectrogram-log-frequency-axis-and.html

And the code is here:
https://github.com/jdesbonnet/joe-desbonnet-blog/tree/master/projects/sox-log-spectrogram

If this code is worth contributing please advise what are the next steps
(if any). Consider this code contributed under whatever terms that are
required to have it added to the project.

Regards,

Joe Desbonnet.

[-- Attachment #1.2: Type: text/html, Size: 1480 bytes --]

[-- Attachment #2: Type: text/plain, Size: 382 bytes --]

------------------------------------------------------------------------------
Android apps run on BlackBerry 10
Introducing the new BlackBerry 10.2.1 Runtime for Android apps.
Now with support for Jelly Bean, Bluetooth, Mapview and more.
Get your Android app in front of a whole new audience.  Start now.
http://pubads.g.doubleclick.net/gampad/clk?id=124407151&iu=/4140/ostg.clktrk

[-- Attachment #3: Type: text/plain, Size: 158 bytes --]

_______________________________________________
SoX-devel mailing list
SoX-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sox-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Modification to spectrogram.c for log frequency axis and setting lower/upper chart frequency
  2014-02-17  0:21 Modification to spectrogram.c for log frequency axis and setting lower/upper chart frequency Joe Desbonnet
@ 2014-02-17  6:14 ` Eric Wong
  2014-02-17 11:36   ` Joe Desbonnet
  0 siblings, 1 reply; 3+ messages in thread
From: Eric Wong @ 2014-02-17  6:14 UTC (permalink / raw)
  To: sox-devel

Joe Desbonnet <jdesbonnet@gmail.com> wrote:
> If this code is worth contributing please advise what are the next steps
> (if any). Consider this code contributed under whatever terms that are
> required to have it added to the project.

You mentioned there was already an open feature request?  uploading the
patch to the bugtracker should be a start.  AFAIK, most of the sox
developers are busy at the moment with real-life stuff.

I just cloned your blog and looked at it (a diff/cloned sox.git repo
would've been better), and it looks mostly OK...
Did you make sure log10_high_freq != log10_low_freq anywhere?  Otherwise
you might divide by zero:

   float log_scale = (float)p->rows/(log10_high_freq - log10_low_freq);

I'm only a simple C programmer and don't know the math behind
spectrograms, though.

(*) not sure how pick sox devs are about trailing whitespace,
    but other projects I work tend to be very picky :)

------------------------------------------------------------------------------
Android apps run on BlackBerry 10
Introducing the new BlackBerry 10.2.1 Runtime for Android apps.
Now with support for Jelly Bean, Bluetooth, Mapview and more.
Get your Android app in front of a whole new audience.  Start now.
http://pubads.g.doubleclick.net/gampad/clk?id=124407151&iu=/4140/ostg.clktrk

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Modification to spectrogram.c for log frequency axis and setting lower/upper chart frequency
  2014-02-17  6:14 ` Eric Wong
@ 2014-02-17 11:36   ` Joe Desbonnet
  0 siblings, 0 replies; 3+ messages in thread
From: Joe Desbonnet @ 2014-02-17 11:36 UTC (permalink / raw)
  To: sox-devel


[-- Attachment #1.1: Type: text/plain, Size: 1821 bytes --]

Eric,

Thanks for the feedback. Ya, good point re the low==high /0 problem. Forced
low<high when parsing cmd line opts. Added diff to my git repository and
updated ticket with link to the patch.

Regards,

Joe.



On Mon, Feb 17, 2014 at 6:14 AM, Eric Wong <normalperson@yhbt.net> wrote:

> Joe Desbonnet <jdesbonnet@gmail.com> wrote:
> > If this code is worth contributing please advise what are the next steps
> > (if any). Consider this code contributed under whatever terms that are
> > required to have it added to the project.
>
> You mentioned there was already an open feature request?  uploading the
> patch to the bugtracker should be a start.  AFAIK, most of the sox
> developers are busy at the moment with real-life stuff.
>
> I just cloned your blog and looked at it (a diff/cloned sox.git repo
> would've been better), and it looks mostly OK...
> Did you make sure log10_high_freq != log10_low_freq anywhere?  Otherwise
> you might divide by zero:
>
>    float log_scale = (float)p->rows/(log10_high_freq - log10_low_freq);
>
> I'm only a simple C programmer and don't know the math behind
> spectrograms, though.
>
> (*) not sure how pick sox devs are about trailing whitespace,
>     but other projects I work tend to be very picky :)
>
>
> ------------------------------------------------------------------------------
> Android apps run on BlackBerry 10
> Introducing the new BlackBerry 10.2.1 Runtime for Android apps.
> Now with support for Jelly Bean, Bluetooth, Mapview and more.
> Get your Android app in front of a whole new audience.  Start now.
>
> http://pubads.g.doubleclick.net/gampad/clk?id=124407151&iu=/4140/ostg.clktrk
> _______________________________________________
> SoX-devel mailing list
> SoX-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/sox-devel
>

[-- Attachment #1.2: Type: text/html, Size: 2654 bytes --]

[-- Attachment #2: Type: text/plain, Size: 382 bytes --]

------------------------------------------------------------------------------
Android apps run on BlackBerry 10
Introducing the new BlackBerry 10.2.1 Runtime for Android apps.
Now with support for Jelly Bean, Bluetooth, Mapview and more.
Get your Android app in front of a whole new audience.  Start now.
http://pubads.g.doubleclick.net/gampad/clk?id=124407151&iu=/4140/ostg.clktrk

[-- Attachment #3: Type: text/plain, Size: 158 bytes --]

_______________________________________________
SoX-devel mailing list
SoX-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sox-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-02-17 11:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-17  0:21 Modification to spectrogram.c for log frequency axis and setting lower/upper chart frequency Joe Desbonnet
2014-02-17  6:14 ` Eric Wong
2014-02-17 11:36   ` Joe Desbonnet

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/sox.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).