Converting a linear equation to decibel

2 visualizzazioni (ultimi 30 giorni)
I'm trying to convert a linear polar plot to decibel but I don't know how to proceed. Here is the original:
theta = 2*pi*linspace(0, 1, 30);
r = cos(theta/2).^2;
polar(theta, r, 'r-');
This is my progress so far:
theta = 2*pi*linspace(0, 1, 30);
r = 10*log10(abs(cos(theta/2).^2));
b = find(r(-40))
b == -40
b = b + 40
polardb(theta, r, -40, 'r-');
I don't know how to proceed.

Risposta accettata

Star Strider
Star Strider il 18 Set 2021
The ‘theta’ vector likely needs to have more points, however that appears to be correct.
I use a slightly different approach here —
theta = 2*pi*linspace(0, 1, 30);
r = cos(theta/2).^2;
figure
polarplot(theta, r, 'r-')
title('r(\theta)')
figure
polarplot(theta, mag2db(r), 'r-')
title('r(\theta) (dB)')
rt = rticklabels;
rticklabels(cellfun(@(x)sprintf('%s dB',x),rt', 'Unif',0))
.
  2 Commenti
flanker989
flanker989 il 18 Set 2021
That helped alot, thank you.
Star Strider
Star Strider il 18 Set 2021
My pleasure!
If my Answer helped you solve your problem, please Accept it!
.

Accedi per commentare.

Più risposte (0)

Prodotti


Release

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by