Logarithmically space a vector

12 ビュー (過去 30 日間)
S
S 2024 年 1 月 28 日
コメント済み: Walter Roberson 2024 年 1 月 28 日
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

採用された回答

Torsten
Torsten 2024 年 1 月 28 日
移動済み: Torsten 2024 年 1 月 28 日
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 件のコメント
S
S 2024 年 1 月 28 日
so y is freq in hz, and what is x?
Walter Roberson
Walter Roberson 2024 年 1 月 28 日
x is point number in the above graph.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMATLAB についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by