Logarithmically space a vector

I am trying to logarithmically space out these center frequnecies. I am unsure how I would do that. At first I though to use logspace instead of linspace but logspace uses base 10. So if I switched it the range would actually be 10^50 to 10^8000 which I do not want. Should I just recaculate what log values are closest to these numbers or is there a better way? Thank you for your time!
numFilts=32;
CenterFreqs = linspace(50, 8000, numFilts);
CF1 = CenterFreqs - BW/2; %Lower cutoff frequency
CF2 = CenterFreqs + BW/2; %Upper cutoff frequency

 Accepted Answer

Torsten
Torsten on 28 Jan 2024
Moved: Torsten on 28 Jan 2024
Maybe you mean
numFilts=32;
CenterFreqs = logspace(log10(50), log10(8000), numFilts)
CenterFreqs = 1×32
1.0e+03 * 0.0500 0.0589 0.0694 0.0817 0.0962 0.1134 0.1335 0.1573 0.1853 0.2182 0.2570 0.3027 0.3566 0.4200 0.4947 0.5827 0.6864 0.8085 0.9523 1.1217 1.3212 1.5563 1.8331 2.1592 2.5432 2.9956 3.5285 4.1561 4.8954 5.7662
plot(1:32,CenterFreqs)

2 Comments

so y is freq in hz, and what is x?
x is point number in the above graph.

Sign in to comment.

More Answers (0)

Categories

Find more on Graph and Network Algorithms in Help Center and File Exchange

Asked:

S
S
on 28 Jan 2024

Commented:

on 28 Jan 2024

Community Treasure Hunt

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

Start Hunting!