0
\$\begingroup\$

I'm trying to plot a -20dB/dec line on MATLAB but can't seem to get it correct. I know that a linear line in a loglog plot is actually an exponential curve in the linear scale. enter image description here

So writing a y = mx + c where m is -20dB/decade is not quite right in MATLAB. The closest I could get to a straight line was using this code below, but as you can see it is not the correct slope or the correct magnitudes.

I have also tried to back calculate it, but haven't solved it. Please help!

Frx = logspace(1,8,100); y = zeros(length(Frx),1); for i = 1:length(Frx) y(i) = 10^(-0.01*(log10(Frx(i)))); end figure; loglog(Frx,y);grid on 
\$\endgroup\$
3
  • 1
    \$\begingroup\$ Seems as though it's just \$y=\frac{10^{8.5}}{x}\$ (linear scale.) I'm not sure where all the difficulty is at. If \$y^{\:'}=20\log_{10}\left(y\right)\$ and \$x^{\:'}=\log_{10}\left(x\right)\$ and therefore your log-log scale formula is just \$y^{\:'}=170-20\cdot x^{\:'}\$, anyway. I don't know anything about MATLAB. Don't use it. But the algebra seems easy enough to me without it. \$\endgroup\$ Commented Oct 13, 2023 at 2:48
  • \$\begingroup\$ @periblepsis Perhaps you could elaborate how you got to that linear scale equation please? Thanks! \$\endgroup\$ Commented Oct 14, 2023 at 23:25
  • \$\begingroup\$ @SM32 Straight substitution and solving for y. I gave you the primed equation and the definition of the primed variables. Take that last equation, substitute the definitions I gave earlier, then solve for y. \$\endgroup\$ Commented Oct 14, 2023 at 23:46

1 Answer 1

2
\$\begingroup\$

A line on a semi-log plot is an exponential; a line on a log-log plot is a power law. 20 dB is a factor of 100, and 'decade' means a factor of ten, so you want the 'decibels' value to be inversely proportional to the square of the frequency.

\$\endgroup\$

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.