From linear to logarithmic distribution
조회 수: 1 (최근 30일)
이전 댓글 표시
Given a linear frequency scale denoted by the vector f = 1:fmax; fmax is known, say 1000.
How can I construct, out of this vector, a logarithmic selection of the entries such that the ratio between two consecutive odd numbers is 1.1?
댓글 수: 0
답변 (1개)
Walter Roberson
2015년 6월 9일
You cannot. The only solution to x*11/10 = x+2 is x = 20, and that is an even number.
If the task is to construct a vector of length fmax such that the ratio
x(2*k+3)/x(2*k+1)
is 11/10 for k in nonnegative integers, then as logarithmic progression is x(n+1) = C * x(n) for some constant C, it follows that x(n+2) = C*(C*x(n)) = C^2 * x(n). You want that value, C^2 to be 1.1, so your C is sqrt(1.1). Then you get
initial_value * sqrt(1.1).^(0:fmax-1)
댓글 수: 2
Walter Roberson
2015년 6월 10일
I have no idea what that code is intended to do. It is uncommented and the relationship to the Question you posted is not obvious.
You start with Lines=1 which is length 1. In the first statement in your while you try to index Lines from 2 to length(Lines_linear) which would be 2:500. But Lines only has 1 entry, so you cannot access elements 2 to 500 of it.
참고 항목
카테고리
Help Center 및 File Exchange에서 Descriptive Statistics에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!