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!