フィルターのクリア

Dual axis plot for the same data, left = linear -1 0 +1, right side= linear in dB -0db inf +0db

1 回表示 (過去 30 日間)
Acoustic wave form plot, amplitude range -1 to 0 to +1 (left side), in dB, -0dB to inf to +0dB (right side). The right and left side would correspond to each other. Zero on the amplitude side equals infinity on the dB side. The plot displays fine except that I'm not able to get the right side to range from -0dB to inf to +0dB. Any ideas would greatly appreciated. Thank you.
  2 件のコメント
Dyuman Joshi
Dyuman Joshi 2023 年 12 月 1 日
"-0dB to inf to +0dB"
I, for one, can't make sense of this.
Jonathan Broyles
Jonathan Broyles 2023 年 12 月 1 日
Ok, the y plot scale on the left is from -1 to +1 which represents the actual values of each sample(amplitude) of data with 0 in the center. In terms of, lets say, digital audio recordings, the -1 is the same as 0dB representing the maximum negative component/amplitude of the signal, the 0 would be the same as infinity representing zero amplitude, and the +1 would be 0dB (or 0dBV), which is the maximum positive component/amplitude value. The maximum values are what can be represented by the digital recording's amplitude resolution.
To illustrate, do you have access to Adobe Audition or iZotope Audio Editor or DC Forensics or AVS Audio Editor or the like? Open/load an audio recording, if setup for dB, the vertical scale has inf (infinity) as the center and dB values numerically increasing from there in both directions.
(Since I'm not a math person, I'm staying away from botching a math description of dB.)
I need to have a similar scale on the right side of my plot.
Thank you.

サインインしてコメントする。

採用された回答

Mathieu NOE
Mathieu NOE 2023 年 12 月 1 日
編集済み: Mathieu NOE 2023 年 12 月 4 日
hello
something like that ?
% dual plot (linear scale left , dB scale right)
yleft_ticks = (-1:0.1:1);
yleft_ticks_labels = num2str(yleft_ticks',3);
yright_ticks = 20*log10(abs(yleft_ticks));
yright_ticks_labels = num2str(yright_ticks',2);
% create plot with yyaxis
x = linspace(0,10);
y = 0.5*sin(x)+0.1*randn(size(x));
yyaxis left
plot(x,y)
ylim([-1 1]);
ylabel('Mag (linear)')
set(gca, 'YTick', yleft_ticks,'YTickLabel', yleft_ticks_labels );
yyaxis right
plot(0,0)
ylim([-1 1]);
ylabel('Mag (dB)')
set(gca, 'YTick', yleft_ticks,'YTickLabel', yright_ticks_labels );
  2 件のコメント
Jonathan Broyles
Jonathan Broyles 2023 年 12 月 1 日
Wow. Fast and perfect.. All I needed to do was change the number ticks and PRESTO! Perfect!
Thank you very much for your quick accurate answer!
Mathieu NOE
Mathieu NOE 2023 年 12 月 4 日
glad I could be of some help
as always, my pleasure !

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMultirate Signal Processing についてさらに検索

製品


リリース

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by