Recalibrating axis of graph automatically generated by Matlab
2 ビュー (過去 30 日間)
古いコメントを表示
I used the PSD function(Eg: psd ECG) to generate the PSD of an ECG signal. The x axis was the normalized frequency and the y-axis the amplitude in dB.
I want to recalibrate the axis so that it shows the frequency in Hertz and the amplitude in mV. How can I do this? If I had written my own PSD fuction then while plotting I could have calibrated the axis according to my requirements.
The problem here is that I am using a pre-defined function to calculate the PSD. So, matlab automatically generates the graph to show freq in a normalized form.
I want to be able to edit the figure so I have the frequency in Hertz. How do i do it.?
1 件のコメント
Walter Roberson
2012 年 10 月 12 日
Please read the guide to tags and retag this Question; see http://www.mathworks.co.uk/matlabcentral/answers/43073-a-guide-to-tags
回答 (1 件)
Walter Roberson
2012 年 10 月 12 日
fs = 8000; %sampling frequency
for H = findobj(gca, '-property', 'xdata')
set(h, 'XData', get(H, 'XData') * (2*fs));
end
I do not happen to recall the conversion between dB and mV, but once you know that you can use code similar to the above.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Bartlett についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!