How to make the x-axis on a logarithmic scale while keeping the y-axis in dB?

125 次查看(过去 30 天)
Hello,
I have calculated the PSD of my signal in dB.
lets say,
f=frequency
Nc= (PSD)Power spectral density in dB
plot(f,Nc);
Now, I would like to change the x-axis to logarithmic scale while keeping the y-axis in dB and plot it. Could you please tell me how to do that?
Thanks
Gaurav

采纳的回答

Wayne King
Wayne King 2012-4-25
semilogx(f,10*log10(Nc))

更多回答(2 个)

Sean de Wolski
Sean de Wolski 2012-4-25
Wayne's method is probably best. However, if you need finer control you can set the axes' xscale property to log.
h = axes;
set(h,'xscale','log')

gaurav Nanda
gaurav Nanda 2012-4-25
Thanks for the help.
I also need to perform curve fitting and to find the value of (C)
This is how I am doing it
g = fittype('a+b./(f.^c)',... 'independent', 'f',... 'coefficients', {'a','b','c'});
f1 = fit(f, Nc, g)
where a= thermal noise
b/f^c is pink noise
I have defined the fittype but I am not able to find the value of c.

类别

Help CenterFile Exchange 中查找有关 Parametric Spectral Estimation 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by