Cos Magnitude changing for unknown reasons
조회 수: 3 (최근 30일)
이전 댓글 표시
This is probably not mat labs fault but i don't understand why my magnitude is changing
If i plot
.5*cos(x)
no surprise my min and max magnitude of the function is -.5 and plus .5
if i plot
.5*cos(2*pi*60*x)
My min max magnitude is changing from -.4 to .5 Why am i loosing .1 on the bottom just by changing the frequency
댓글 수: 0
답변 (1개)
Star Strider
2016년 9월 28일
I don’t know what ‘x’ is, but what you are probably seeing is the phenomenon known as ‘aliasing’, where your sampling frequency is lower than the frequency of your cosine function.
댓글 수: 2
Star Strider
2016년 9월 28일
Not the interval, the sampling frequency.
Example:
x = linspace(0, 1, 1200);
y = .5*cos(2*pi*60*x);
min_max = [min(y), max(y)]
figure(1)
plot(x, y)
grid
min_max =
-0.499998283668634 0.5
This is about as close as you can reasonably get. The inaccuracies are likely those inherent to any floating-point calculations.
참고 항목
카테고리
Help Center 및 File Exchange에서 Line Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!