Recalibrating axis of graph automatically generated by Matlab
1 view (last 30 days)
Show older comments
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 Comment
Walter Roberson
on 12 Oct 2012
Please read the guide to tags and retag this Question; see http://www.mathworks.co.uk/matlabcentral/answers/43073-a-guide-to-tags
Answers (1)
Walter Roberson
on 12 Oct 2012
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 Comments
See Also
Categories
Find more on Colormaps in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!