sox-devel@lists.sourceforge.net unofficial mirror
 help / color / mirror / code / Atom feed
From: Thor Andreassen <ta@toggle.be>
To: sox-devel@lists.sourceforge.net
Subject: Re: spectrogram values
Date: Fri, 22 Jan 2016 18:38:51 +0100	[thread overview]
Message-ID: <20160122173851.GD31540@toggle.be> (raw)
In-Reply-To: <20160120023736.GA31540@toggle.be>

On Wed, Jan 20, 2016 at 03:37:36AM +0100, Thor Andreassen wrote:

[...]

> A crude way of getting the raw numbers could be to use the color values
> from the generated png file, e.g. with Imagemagick:
> 
>     sox -n -n synth 1 synth 1k:5k spectrogram -r -o - |
>     convert png:- txt:-                 |
>     
>     # translate into Gnuplot compatible input
>     awk -v FS='[,:() ]+' 'NR > 2               { print $1, $2, ($3+$4+$5)/3 }'  |
>     awk                  'NR > 2 && $2 != prev { printf "\n" } { prev = $2 } 1' \
>     > spectrogram.dat

With the rgbimage feature of Gnuplot, you can actually access the pixels
directly, e.g.:

    echo "plot 'spectrogram.png' binary filetype=png format='%uchar%uchar%uchar' \
           using 1:2:3 with rgbimage" | gnuplot --persist

Or if you want to set the red channel to zero:

    echo "plot 'spectrogram.png' binary filetype=png format='%uchar%uchar%uchar' \
           using (0):2:3 with rgbimage" | gnuplot --persist

[...]

-- 
best regards
Thor Andreassen

------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140

  parent reply	other threads:[~2016-01-22 17:39 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-08 14:31 spectrogram values Markus Glugla
2016-01-20  2:37 ` Thor Andreassen
2016-01-21 15:33   ` Pander
2016-01-22 23:54     ` Thor Andreassen
2016-01-26 12:24       ` Pander
2016-01-22 17:38   ` Thor Andreassen [this message]
2016-01-28 12:51   ` Markus Glugla
2016-01-28 13:00     ` Pander
2016-01-28 14:47       ` Markus Glugla
2016-01-28 16:17         ` Pander

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://lists.sourceforge.net/lists/listinfo/sox-devel

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160122173851.GD31540@toggle.be \
    --to=sox-devel@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).