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 CenterFile Exchange에서 MATLAB에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by