wav dataからdB splの求め方

58 views (last 30 days)
Cir 2t
Cir 2t on 16 Sep 2020
Commented: Hernia Baby on 24 Feb 2021
平素よりお世話になっております。
wav dataの電圧波形のデータから音圧(dB単位)を計算したいのですが、いかのように考えたのですが、これで良いか少し不安を抱えています。
検証していただけると幸いです。
%電圧(の実効値)は以下のようになります。
%電圧(V) = 音圧(Pa)×マイク感度(V/Pa)×アンプ利得(倍)
%マイク感度の V/Pa という単位は、1Paの音圧で1Vの出力電圧(実効値)が出るという意味です。
%音圧 0dB というのは20μPaのことなので
%音圧(Pa) = 2×10^(-6)×10^{音圧(dB)/20}
%になります( 1Pa の音圧は 94dB )。したがって元の音量が dB 単位のときは次式で計算できます。
%電圧(V) = 2×10^(-6)×10^{音圧(dB)/20}×マイク感度(V/Pa)×アンプ利得(倍)
%逆に電圧の実効値から音圧を計算するには
%音圧 (dB) = 20*log10[ 電圧(V)/{ 2×10^(-6)×マイク感度(V/Pa)×アンプ利得(倍)} ]
マイク感度は、4mV/Paです。アンプゲインは、20dBです。ですので、下記のようにコードを書きました。
absは、複素数になっていたので入れました。
v=data;
a= 2*10^(-6);
m=4*10^(-3);
amp=20;
dB=20*log10(abs(data/(a*m*amp)));
Thank you for your continued support.
I'd like to calculate the sound pressure (in dB) from the voltage waveform data of wav data, but I'm a little worried about if this is okay.
I would appreciate it if you could verify it.
% Voltage (effective value) is as follows.
% Voltage (V) = Sound pressure (Pa) x Microphone sensitivity (V / Pa) x Amplifier gain (times)
% The unit of microphone sensitivity V / Pa means that 1V output voltage (effective value) is output at 1Pa sound pressure.
% Sound pressure 0dB means 20μPa
% Sound pressure (Pa) = 2 × 10 ^ (-6) × 10 ^ {Sound pressure (dB) / 20}
It becomes% (sound pressure of 1Pa is 94dB). Therefore, when the original volume is in dB, it can be calculated by the following formula.
% Voltage (V) = 2 × 10 ^ (-6) × 10 ^ {Sound pressure (dB) / 20} × Microphone sensitivity (V / Pa) × Amplifier gain (times)
% Conversely, to calculate the sound pressure from the effective value of the voltage
% Sound pressure (dB) = 20 * log10 [Voltage (V) / {2 × 10 ^ (-6) × Microphone sensitivity (V / Pa) × Amplifier gain (times)}]
The microphone sensitivity is 4 mV / Pa. The amplifier gain is 20 dB. So I wrote the code as below.
abs was a complex number, so I put it in.
  3 Comments
Cir 2t
Cir 2t on 17 Sep 2020
Mr. Rik.
Thank you for translating my Japanese into English.
Hernia Baby
Hernia Baby on 24 Feb 2021
複素数ということはFFTをかけたのでしょうか?
であれば正規化が必要だと思われます。

Sign in to comment.

Answers (0)

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!