Recalibrating axis of graph automatically generated by Matlab
5 views (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.?
Please read the guide to tags and retag this Question; see http://www.mathworks.co.uk/matlabcentral/answers/43073-a-guide-to-tags
fs = 8000; %sampling frequency
for H = findobj(gca, '-property', 'xdata')
set(h, 'XData', get(H, 'XData') * (2*fs));
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.
Find more on Parametric Modeling 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!