How to use microphone calibration file

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

How to use microphone calibration file

Pander
Hi all,

I have an UMIK-1 (a calibrated USB microphone) and use rec from sox for
recording. I use a Raspberry Pi and try to get the most out of it in
terms of quality. I am using the following commands:

  export AUDIODEV=hw:1,0
  export AUDIODRIVER=alsa
  rec -q -r 48000 -c 1 -b 24 --buffer 16384 test.wav trim 0 300

1) Should I worry about the following message?

  rec WARN formats: can't set 1 channels; using 2

because the recording results in

  file test.wav
  test.wav: RIFF (little-endian) data, WAVE audio, mono 48000 Hz

and Audacity reports

  Mono, 96000Hz
  32-bit float

2) I doubled the buffer size but sometimes I get

  rec WARN alsa: over-run

but that seems to be independent of the doubling of the buffer size and
only occurs on start up. What is smart to do here?

3) How do I use the microphone calibration file? I can download it from

  http://www.minidsp.com/products/acoustic-measurement/umik-1

and looks like

  Sens Factor =.27710dB, SERNO: 7007***
  10.054 -5.3961
  10.179 -5.2292
  10.306 -5.0655
  ...
  19527.604 -0.7159
  19770.697 -0.7462
  20016.816 -0.7772

A simple line plot of the entire files reveals as

  https://i.imgur.com/ISO0WHh.png

4) Are there more ways to optimise recording in this way?

5) As next step, I am using this command to create a spectrogram

  sox test.wav -n remix - rate .25k spectrogram -x 1776 -y 512 -c 125Hz

Could the latter command also be optimised or should calibration
correction take place here?

6) When calibration is used, does the spectrogram reflect dB properly or
is more processing needed?

Thanks,

Pander

------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
_______________________________________________
Sox-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sox-users
Reply | Threaded
Open this post in threaded view
|

Re: How to use microphone calibration file

Jan Stary
On Dec 15 13:24:04, [hidden email] wrote:

> Hi all,
>
> I have an UMIK-1 (a calibrated USB microphone) and use rec from sox for
> recording. I use a Raspberry Pi and try to get the most out of it in
> terms of quality. I am using the following commands:
>
>   export AUDIODEV=hw:1,0
>   export AUDIODRIVER=alsa
>   rec -q -r 48000 -c 1 -b 24 --buffer 16384 test.wav trim 0 300
>
> 1) Should I worry about the following message?
>
>   rec WARN formats: can't set 1 channels; using 2
>
> because the recording results in
>
>   file test.wav
>   test.wav: RIFF (little-endian) data, WAVE audio, mono 48000 Hz

Record with 'rec -V' instead and show us the output.
The run soxi on the recorded file and show us the output.

> and Audacity reports
>
>   Mono, 96000Hz
>   32-bit float
>
> 2) I doubled the buffer size but sometimes I get
>
>   rec WARN alsa: over-run
>
> but that seems to be independent of the doubling of the buffer size and
> only occurs on start up. What is smart to do here?

Record without messing with the buffer first, and see if it is happening.
Do you have any 'sound daemon' running, such as alsad? In other words,
is SoX recording directly from the device, or is there a middleman?

> 3) How do I use the microphone calibration file? I can download it from
>
>   http://www.minidsp.com/products/acoustic-measurement/umik-1
>
> and looks like
>
>   Sens Factor =.27710dB, SERNO: 7007***
>   10.054 -5.3961
>   10.179 -5.2292
>   10.306 -5.0655
>   ...
>   19527.604 -0.7159
>   19770.697 -0.7462
>   20016.816 -0.7772
>
> A simple line plot of the entire files reveals as
>
>   https://i.imgur.com/ISO0WHh.png

How do you suppose the calibration file should be "used"
and what do you picture as an output of such usage?

> 4) Are there more ways to optimise recording in this way?

What "this way"? You have a microphone. How do you suppose
to "optimize" recording with it using a calibration measurement?

> 5) As next step, I am using this command to create a spectrogram
>
>   sox test.wav -n remix - rate .25k spectrogram -x 1776 -y 512 -c 125Hz

First of all, this command makes my 14.4.1 segfault.
Without the -x argument to the spectrogram effect, it works.
Without running 'rate' first, it works.

Why are you changing the rate (and why to .25k)
before running the spectrogram effect? Are you trying to make
a spectrogram of a low frequency band only? Why?

> Could the latter command also be optimised or should calibration
> correction take place here?

What would be an "optimized" spectrogram?

> 6) When calibration is used,

How do you think "calibration is used" here?

> does the spectrogram reflect dB properly or
> is more processing needed?

------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
_______________________________________________
Sox-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sox-users
Reply | Threaded
Open this post in threaded view
|

Re: How to use microphone calibration file

Pander
On 12/16/2014 07:52 AM, Jan Stary wrote:

> On Dec 15 13:24:04, [hidden email] wrote:
>> Hi all,
>>
>> I have an UMIK-1 (a calibrated USB microphone) and use rec from sox for
>> recording. I use a Raspberry Pi and try to get the most out of it in
>> terms of quality. I am using the following commands:
>>
>>   export AUDIODEV=hw:1,0
>>   export AUDIODRIVER=alsa
>>   rec -q -r 48000 -c 1 -b 24 --buffer 16384 test.wav trim 0 300
>>
>> 1) Should I worry about the following message?
>>
>>   rec WARN formats: can't set 1 channels; using 2
>>
>> because the recording results in
>>
>>   file test.wav
>>   test.wav: RIFF (little-endian) data, WAVE audio, mono 48000 Hz
>
> Record with 'rec -V' instead and show us the output.

rec -V -r 48000 -c 1 -b 24 test.wav trim 0 10
rec:      SoX v14.4.0
rec WARN formats: can't set 1 channels; using 2

Input File     : 'hw:1,0' (alsa)
Channels       : 2
Sample Rate    : 48000
Precision      : 24-bit
Sample Encoding: 24-bit Signed Integer PCM
Endian Type    : little
Reverse Nibbles: no
Reverse Bits   : no


Output File    : 'test.wav'
Channels       : 1
Sample Rate    : 48000
Precision      : 24-bit
Sample Encoding: 24-bit Signed Integer PCM
Endian Type    : little
Reverse Nibbles: no
Reverse Bits   : no
Comment        : 'Processed by SoX'

rec INFO sox: effects chain: input        48000Hz  2 channels
rec INFO sox: effects chain: trim         48000Hz  2 channels
rec INFO sox: effects chain: channels     48000Hz  1 channels
rec INFO sox: effects chain: output       48000Hz  1 channels
In:0.00% 00:00:10.07 [00:00:00.00] Out:480k  [      |      ]
Clip:0
Done.

> The run soxi on the recorded file and show us the output.

Channels       : 1
Sample Rate    : 48000
Precision      : 24-bit
Duration       : 00:59:00.00 = 169920000 samples ~ 265500 CDDA sectors
File Size      : 510M
Bit Rate       : 1.15M
Sample Encoding: 24-bit Signed Integer PCM

>> and Audacity reports
>>
>>   Mono, 96000Hz
>>   32-bit float

So answer to 1) is no.

>> 2) I doubled the buffer size but sometimes I get
>>
>>   rec WARN alsa: over-run
>>
>> but that seems to be independent of the doubling of the buffer size and
>> only occurs on start up. What is smart to do here?
>
> Record without messing with the buffer first, and see if it is happening.
> Do you have any 'sound daemon' running, such as alsad? In other words,
> is SoX recording directly from the device, or is there a middleman?

$ dpkg -l|grep alsa|awk '{print $2" "$3}'
alsa-base 1.0.25+3~deb7u1
alsa-utils 1.0.25-4
gstreamer1.0-alsa:armhf 1.2.0-1co1rpi3
libsox-fmt-alsa 14.4.0-3

$ ps -aef|grep alsa
does not report anything, also no OSS or pulse

>> 3) How do I use the microphone calibration file? I can download it from
>>
>>   http://www.minidsp.com/products/acoustic-measurement/umik-1
>>
>> and looks like
>>
>>   Sens Factor =.27710dB, SERNO: 7007***
>>   10.054 -5.3961
>>   10.179 -5.2292
>>   10.306 -5.0655
>>   ...
>>   19527.604 -0.7159
>>   19770.697 -0.7462
>>   20016.816 -0.7772
>>
>> A simple line plot of the entire files reveals as
>>
>>   https://i.imgur.com/ISO0WHh.png
>
> How do you suppose the calibration file should be "used"
> and what do you picture as an output of such usage?

I suppose that a convolution will do the needed correction. Is there a
common procedure for this?

Is this best done while recording or better done in post-processing?

I have no idea yet what to do with the sens factor and the fact that the
mic is reporting gain of 18 dB.

$ arecord -l
**** List of CAPTURE Hardware Devices ****
card 1: U18dB [Umik-1  Gain: 18dB], device 0: USB Audio [USB Audio]
  Subdevices: 0/1
  Subdevice #0: subdevice #0

I understand the theoretical part but have no experience with this yet
in a practical way. Since it is a calibrated microphone, I would like to
use the best toolchain to get the maximum resolution and the loudness in
dB as correct as possible.

>> 4) Are there more ways to optimise recording in this way?
>
> What "this way"? You have a microphone. How do you suppose
> to "optimize" recording with it using a calibration measurement?

I was wondering if other parameters for rec were needed.

>> 5) As next step, I am using this command to create a spectrogram
>>
>>   sox test.wav -n remix - rate .25k spectrogram -x 1776 -y 512 -c 125Hz
>
> First of all, this command makes my 14.4.1 segfault.
> Without the -x argument to the spectrogram effect, it works.
> Without running 'rate' first, it works.

The remix is when a stereo recording is being used but that is not the
case here. The rate works here with 14.4.0-3

sox test.wav -n remix - rate .25k spectrogram -x 1776 -y 512 -c test

> Why are you changing the rate (and why to .25k)
> before running the spectrogram effect? Are you trying to make
> a spectrogram of a low frequency band only? Why?

Yes, I am monitoring low frequency noise 24/7 with a Raspberry Pi.

>> Could the latter command also be optimised or should calibration
>> correction take place here?
>
> What would be an "optimized" spectrogram?
>
>> 6) When calibration is used,
>
> How do you think "calibration is used" here?

Here is an example https://i.imgur.com/sw4rbAx.png of one of the
measurements. I am trying to get from https://en.wikipedia.org/wiki/DBFS
to https://en.wikipedia.org/wiki/Decibel hence the previous questions on
sox.

>> does the spectrogram reflect dB properly or
>> is more processing needed?
>
> ------------------------------------------------------------------------------
> Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
> from Actuate! Instantly Supercharge Your Business Reports and Dashboards
> with Interactivity, Sharing, Native Excel Exports, App Integration & more
> Get technology previously reserved for billion-dollar corporations, FREE
> http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
> _______________________________________________
> Sox-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/sox-users
>


------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
_______________________________________________
Sox-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sox-users
Reply | Threaded
Open this post in threaded view
|

Re: How to use microphone calibration file

Jan Stary
On Dec 17 01:28:36, [hidden email] wrote:

> On 12/16/2014 07:52 AM, Jan Stary wrote:
> > On Dec 15 13:24:04, [hidden email] wrote:
> >> Hi all,
> >>
> >> I have an UMIK-1 (a calibrated USB microphone) and use rec from sox for
> >> recording. I use a Raspberry Pi and try to get the most out of it in
> >> terms of quality. I am using the following commands:
> >>
> >>   export AUDIODEV=hw:1,0
> >>   export AUDIODRIVER=alsa
> >>   rec -q -r 48000 -c 1 -b 24 --buffer 16384 test.wav trim 0 300
> >>
> >> 1) Should I worry about the following message?
> >>
> >>   rec WARN formats: can't set 1 channels; using 2
> >>
> >> because the recording results in
> >>
> >>   file test.wav
> >>   test.wav: RIFF (little-endian) data, WAVE audio, mono 48000 Hz
> >
> > Record with 'rec -V' instead and show us the output.
>
> rec -V -r 48000 -c 1 -b 24 test.wav trim 0 10
> rec:      SoX v14.4.0
> rec WARN formats: can't set 1 channels; using 2
>
> Input File     : 'hw:1,0' (alsa)
> Channels       : 2
> Sample Rate    : 48000
> Precision      : 24-bit
> Sample Encoding: 24-bit Signed Integer PCM
> Endian Type    : little
> Reverse Nibbles: no
> Reverse Bits   : no
>
>
> Output File    : 'test.wav'
> Channels       : 1
> Sample Rate    : 48000
> Precision      : 24-bit
> Sample Encoding: 24-bit Signed Integer PCM
> Endian Type    : little
> Reverse Nibbles: no
> Reverse Bits   : no
> Comment        : 'Processed by SoX'
>
> rec INFO sox: effects chain: input        48000Hz  2 channels
> rec INFO sox: effects chain: trim         48000Hz  2 channels
> rec INFO sox: effects chain: channels     48000Hz  1 channels
> rec INFO sox: effects chain: output       48000Hz  1 channels
> In:0.00% 00:00:10.07 [00:00:00.00] Out:480k  [      |      ]
> Clip:0
> Done.
>
> > The run soxi on the recorded file and show us the output.
>
> Channels       : 1
> Sample Rate    : 48000
> Precision      : 24-bit
> Duration       : 00:59:00.00 = 169920000 samples ~ 265500 CDDA sectors
> File Size      : 510M
> Bit Rate       : 1.15M
> Sample Encoding: 24-bit Signed Integer PCM
>
> >> and Audacity reports
> >>
> >>   Mono, 96000Hz
> >>   32-bit float
>
> So answer to 1) is no.

Eh, and plain old file(1) is actually more acurate
about audio file formats than Audacity.

>
> >> 2) I doubled the buffer size but sometimes I get
> >>
> >>   rec WARN alsa: over-run
> >>
> >> but that seems to be independent of the doubling of the buffer size and
> >> only occurs on start up. What is smart to do here?
> >
> > Record without messing with the buffer first, and see if it is happening.
> > Do you have any 'sound daemon' running, such as alsad? In other words,
> > is SoX recording directly from the device, or is there a middleman?
>
> $ dpkg -l|grep alsa|awk '{print $2" "$3}'
> alsa-base 1.0.25+3~deb7u1
> alsa-utils 1.0.25-4
> gstreamer1.0-alsa:armhf 1.2.0-1co1rpi3
> libsox-fmt-alsa 14.4.0-3
>
> $ ps -aef|grep alsa
> does not report anything, also no OSS or pulse
>
> >> 3) How do I use the microphone calibration file? I can download it from
> >>
> >>   http://www.minidsp.com/products/acoustic-measurement/umik-1
> >>
> >> and looks like
> >>
> >>   Sens Factor =.27710dB, SERNO: 7007***
> >>   10.054 -5.3961
> >>   10.179 -5.2292
> >>   10.306 -5.0655
> >>   ...
> >>   19527.604 -0.7159
> >>   19770.697 -0.7462
> >>   20016.816 -0.7772
> >>
> >> A simple line plot of the entire files reveals as
> >>
> >>   https://i.imgur.com/ISO0WHh.png
> >
> > How do you suppose the calibration file should be "used"
> > and what do you picture as an output of such usage?
>
> I suppose that a convolution will do the needed correction.
> Is there a common procedure for this?

What "needed correction" of what? You have a wav file.
The 'spectrogram' effect of SoX will make you a spectrogram.
There is no way to tell SoX "this file was recorded with
this microphone which has this freq response, so make the
spectrogram a bit different". It that's what you are asking.

> Is this best done while recording or better done in post-processing?
> I have no idea yet what to do with the sens factor and the fact that the
> mic is reporting gain of 18 dB.
>
> $ arecord -l
> **** List of CAPTURE Hardware Devices ****
> card 1: U18dB [Umik-1  Gain: 18dB], device 0: USB Audio [USB Audio]
>   Subdevices: 0/1
>   Subdevice #0: subdevice #0
>
> I understand the theoretical part but have no experience with this yet
> in a practical way. Since it is a calibrated microphone, I would like to
> use the best toolchain to get the maximum resolution and the loudness in
> dB as correct as possible.
>
> >> 4) Are there more ways to optimise recording in this way?
> >
> > What "this way"? You have a microphone. How do you suppose
> > to "optimize" recording with it using a calibration measurement?
>
> I was wondering if other parameters for rec were needed.

No.

> >> 5) As next step, I am using this command to create a spectrogram
> >>
> >>   sox test.wav -n remix - rate .25k spectrogram -x 1776 -y 512 -c 125Hz
> >
> > First of all, this command makes my 14.4.1 segfault.
> > Without the -x argument to the spectrogram effect, it works.
> > Without running 'rate' first, it works.
>
> The remix is when a stereo recording is being used but that is not the
> case here. The rate works here with 14.4.0-3

Can you please try with 14.4.1 to see if it's a bug
introduced in 14.4.1?

> sox test.wav -n remix - rate .25k spectrogram -x 1776 -y 512 -c test
>
> > Why are you changing the rate (and why to .25k)
> > before running the spectrogram effect? Are you trying to make
> > a spectrogram of a low frequency band only? Why?
>
> Yes, I am monitoring low frequency noise 24/7 with a Raspberry Pi.

Why don't you get a microphone much more suitable for that band then?
Why are you recording low frequency noise at 48kHz?


> >> Could the latter command also be optimised or should calibration
> >> correction take place here?
> >
> > What would be an "optimized" spectrogram?
> >
> >> 6) When calibration is used,
> >
> > How do you think "calibration is used" here?
>
> Here is an example https://i.imgur.com/sw4rbAx.png of one of the
> measurements. I am trying to get from https://en.wikipedia.org/wiki/DBFS
> to https://en.wikipedia.org/wiki/Decibel hence the previous questions on
> sox.

I have no idea what you are talking about.
What is the ultimate goal of all this?
You record some low freq noise, and make a spectorgram of it.
Then what?


------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
_______________________________________________
Sox-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sox-users
Reply | Threaded
Open this post in threaded view
|

Re: How to use microphone calibration file

Erich Eckner
Hi Pander,

to me it sounds like you would like to correct for the frequency
response of your microphone.
I don't know an effect, which does this with one invocation (like a
graphical 32-band equalizer), but take a look at the following effects:
equalizer, bass, treble

@community: Wouldn't it be nice to have some multi-band-equalizer
effect? E.g. "graphical-equalizer {frequency[k] gain}"

It looks to me, like you need to combine
1x "bass", 1x "treble" and (n-1)x "equalizer"
to represent a calibration file with n points.
Preferably, you should calculate the parameters in a script, otherwise
you would end up with a quite long command line.

However, I don't see a simple way to test the combined "microphone
correction" effect chain. As far as I see, you need to generate white
noise (with synth), send it through your chain, and look at the
spectrogram afterwards.
A different approach to test the "microphone correction" effect chain,
was to invoke "--plot" on each part and afterwards combine the graphs
somehow :-/

@community: Another dream of me: Why not have a --plot equivalent, which
gives the transfer function of the whole effect chain (I mean the parts,
which support "--plot" right now, combined)? This might be obsolete, if
there is some graphical-equalizer effect. Or vice versa.

Greetings,
Erich



------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
_______________________________________________
Sox-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sox-users

signature.asc (851 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: New effect - was: How to use microphone calibration file

Fmiser
> Erich wrote:
>
> @community: Wouldn't it be nice to have some multi-band-equalizer
> effect? E.g. "graphical-equalizer {frequency[k] gain}"

I think the existing equalizer effect does just fine.  What would
"graphical-equalizer" do that the existing doesn't?  The only thing
I see is it would have a fixed Q/bandwidth.  I'm failing to see and
advantage in that...  You could just set the Q at 2 for all of them.

> However, I don't see a simple way to test the combined "microphone
> correction" effect chain. As far as I see, you need to generate
> white noise (with synth), send it through your chain, and look at
> the spectrogram afterwards.

White noise requires time for the random nature to settle on an
average of flat.  A frequency sweep can be quicker and more
accurate.

For viewing, I often use baudline, a powerful signal viewing tool.

> @community: Another dream of me: Why not have a --plot
> equivalent, which gives the transfer function of the whole effect
> chain (I mean the parts, which support "--plot" right now,
> combined)? This might be obsolete, if there is some
> graphical-equalizer effect. Or vice versa.

Yeah,  I'd like to have a plot of all the steps in the chain.  I
don't see how your proposed "graphical-equalizer" effect would make
it obsolete, though.  Oh - unless as a single effect it takes
multiple frequency/gain pairs.

--  Philip

------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
_______________________________________________
Sox-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sox-users
Reply | Threaded
Open this post in threaded view
|

Re: How to use microphone calibration file

Pander
In reply to this post by Erich Eckner
On 12/17/2014 03:24 PM, Erich Eckner wrote:

> Hi Pander,
>
> to me it sounds like you would like to correct for the frequency
> response of your microphone.
> I don't know an effect, which does this with one invocation (like a
> graphical 32-band equalizer), but take a look at the following effects:
> equalizer, bass, treble
>
> @community: Wouldn't it be nice to have some multi-band-equalizer
> effect? E.g. "graphical-equalizer {frequency[k] gain}"
>
> It looks to me, like you need to combine
> 1x "bass", 1x "treble" and (n-1)x "equalizer"
> to represent a calibration file with n points.
> Preferably, you should calculate the parameters in a script, otherwise
> you would end up with a quite long command line.

The calibration file has 615 bands. Is this approach feasible?

> However, I don't see a simple way to test the combined "microphone
> correction" effect chain. As far as I see, you need to generate white
> noise (with synth), send it through your chain, and look at the
> spectrogram afterwards.
> A different approach to test the "microphone correction" effect chain,
> was to invoke "--plot" on each part and afterwards combine the graphs
> somehow :-/

The alternative is to use e.g. NumPy, brutefir or jconvolver on the WAV
file. NumPy could make the spectrogram then directly.

> @community: Another dream of me: Why not have a --plot equivalent, which
> gives the transfer function of the whole effect chain (I mean the parts,
> which support "--plot" right now, combined)? This might be obsolete, if
> there is some graphical-equalizer effect. Or vice versa.

I am not afraid to help out in C to help add a filtering step in the
frequency domain directly after the FFT. This shouldn't be too hard.

The calibration file, which is a smooth curve, needs to be made
continuous with interpolation (linear interpolation would suffice). Then
the signal in the frequency domain needs simply to be multiplied for
each value by looking up the factor based on the frequency.

With some mentoring, I am willing to implement this. Most important part
will be implementing checks and how to deal with extreme values.



Another thing on recording with rec is the following; I am getting some
repetitions in the frequency domain. It also shows up when I create
spectrogram with audacity. (all is 24-bit but also shows in 16-bit)

sample freq --- sox --- audacity
 8000 https://i.imgur.com/8yNNAH0.png
11025 https://i.imgur.com/9eqbXOv.png
16000 https://i.imgur.com/bfZZyRy.png https://i.imgur.com/YGqOHV2.png
44100 https://i.imgur.com/bhM44L0.png
48000 https://i.imgur.com/mtojMgF.png https://i.imgur.com/qt4u1p4.png

Here it are lines but with realistic recoding I see also complete
signals repeated. How can I fix this?

Regards,

Pander

> Greetings,
> Erich
>
>
>
>
> ------------------------------------------------------------------------------
> Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
> from Actuate! Instantly Supercharge Your Business Reports and Dashboards
> with Interactivity, Sharing, Native Excel Exports, App Integration & more
> Get technology previously reserved for billion-dollar corporations, FREE
> http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
>
>
>
> _______________________________________________
> Sox-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/sox-users
>


------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
_______________________________________________
Sox-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sox-users
Reply | Threaded
Open this post in threaded view
|

Re: How to use microphone calibration file

Pander
In reply to this post by Jan Stary
On 12/17/2014 02:54 PM, Jan Stary wrote:
> On Dec 17 01:28:36, [hidden email] wrote:
>> On 12/16/2014 07:52 AM, Jan Stary wrote:
>>> On Dec 15 13:24:04, [hidden email] wrote:
...

>>>> 5) As next step, I am using this command to create a spectrogram
>>>>
>>>>   sox test.wav -n remix - rate .25k spectrogram -x 1776 -y 512 -c 125Hz
>>>
>>> First of all, this command makes my 14.4.1 segfault.
>>> Without the -x argument to the spectrogram effect, it works.
>>> Without running 'rate' first, it works.
>>
>> The remix is when a stereo recording is being used but that is not the
>> case here. The rate works here with 14.4.0-3
>
> Can you please try with 14.4.1 to see if it's a bug
> introduced in 14.4.1?

It works fine on 14.4.1-4 on Ubuntu. Perhaps there went something wrong
with the test. I also had a few times but the recording was probably too
short. Does that reproduce it?

>> sox test.wav -n remix - rate .25k spectrogram -x 1776 -y 512 -c test
>>
>>> Why are you changing the rate (and why to .25k)
>>> before running the spectrogram effect? Are you trying to make
>>> a spectrogram of a low frequency band only? Why?
>>
>> Yes, I am monitoring low frequency noise 24/7 with a Raspberry Pi.
>
> Why don't you get a microphone much more suitable for that band then?
> Why are you recording low frequency noise at 48kHz?

The application can also be to monitor higher sounds. I choose a general
purpose measuring calibrated microphone. What woudl you recommend for LF
domain?

>>>> 6) When calibration is used,
>>>
>>> How do you think "calibration is used" here?
>>
>> Here is an example https://i.imgur.com/sw4rbAx.png of one of the
>> measurements. I am trying to get from https://en.wikipedia.org/wiki/DBFS
>> to https://en.wikipedia.org/wiki/Decibel hence the previous questions on
>> sox.
>
> I have no idea what you are talking about.
> What is the ultimate goal of all this?
> You record some low freq noise, and make a spectorgram of it.
> Then what?

0 dBFS is maximum of recording amplitude. The spectrogram plots all
below that level. I want to be able to map those dBFS values to acoustic
dB values https://en.wikipedia.org/wiki/Decibel#Acoustics

Since the microphone is calibrated and all specs are available, that
should be possible. If this is outside the domain of this mailing list
could anyone tell me what is a better location to discuss this.

Regards,

Pander

------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
_______________________________________________
Sox-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sox-users
Reply | Threaded
Open this post in threaded view
|

Re: How to use microphone calibration file

Jan Stary
In reply to this post by Pander
On Dec 18 16:57:24, [hidden email] wrote:
> The calibration file has 615 bands. Is this approach feasible?

A much more feasible approach is to get a microphone
with a flat response in the band you are recording
and be done with it.

> > However, I don't see a simple way to test the combined "microphone
> > correction" effect chain. As far as I see, you need to generate white
> > noise (with synth), send it through your chain, and look at the
> > spectrogram afterwards.
> > A different approach to test the "microphone correction" effect chain,
> > was to invoke "--plot" on each part and afterwards combine the graphs
> > somehow :-/
>
> The alternative is to use e.g. NumPy, brutefir or jconvolver on the WAV
> file. NumPy could make the spectrogram then directly.

SoX could make the spectrogram then directly, from the "corrected" file.
What you are asking for is an envelope; that would be interesting to have.

> The calibration file, which is a smooth curve, needs to be made
> continuous with interpolation (linear interpolation would suffice).

It's not a smooth curve,
and a smooth curve does not need to be made continuous.

> Then the signal in the frequency domain needs simply to be multiplied for
> each value by looking up the factor based on the frequency.

Yes. That's finitely many discrete values though,
not a smooth curve.

> Another thing on recording with rec is the following; I am getting some
> repetitions in the frequency domain. It also shows up when I create
> spectrogram with audacity. (all is 24-bit but also shows in 16-bit)
>
> sample freq --- sox --- audacity
>  8000 https://i.imgur.com/8yNNAH0.png
> 11025 https://i.imgur.com/9eqbXOv.png
> 16000 https://i.imgur.com/bfZZyRy.png https://i.imgur.com/YGqOHV2.png
> 44100 https://i.imgur.com/bhM44L0.png
> 48000 https://i.imgur.com/mtojMgF.png https://i.imgur.com/qt4u1p4.png

These are harmonic overtones. What about them?

> Here it are lines but with realistic recoding I see also complete
> signals repeated.

Can you show us an example?
And what are the above (if they are not "realistic recordings")?

        Jan


------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
_______________________________________________
Sox-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sox-users
Reply | Threaded
Open this post in threaded view
|

Re: How to use microphone calibration file

Pander
In reply to this post by Pander
I could reproduce the segfault with rate parameter on Ubuntu with sox
14.4.1-4 but there is no segfault on Raspbian with sox 14.4.0-3. Does
this mean a bug was introduced between those two versions? Could somone
investigate this please?

------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
_______________________________________________
Sox-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sox-users
Reply | Threaded
Open this post in threaded view
|

Re: How to use microphone calibration file

Jan Stary
In reply to this post by Pander
> >>>>  ox test.wav -n remix - rate .25k spectrogram -x 1776 -y 512 -c 125Hz
> >>>
> >>> First of all, this command makes my 14.4.1 segfault.
> >>> Without the -x argument to the spectrogram effect, it works.
> >>> Without running 'rate' first, it works.

> I also had a few times but the recording was probably too short.
> Does that reproduce it?

Yes, that was exactly it. Thanks.
I am about to send a separate mail about that.


------------------------------------------------------------------------------
Dive into the World of Parallel Programming! The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net
_______________________________________________
Sox-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/sox-users