Plotting sin (x/x) function in terms of Mag(dB) over Frequency
조회 수: 7 (최근 30일)
이전 댓글 표시
x=linspace(-20,20);
y= sin(x)./x;
y1 = (10*log(y));
plot(x,y1,'-')
This is currrently the code i have running but not getting the resulting sin x/x plot, but more so a rectified version of it. i also wanted some help in changing the x axis from linear to frequency(preferably in rad/s), similar to how i changed y from linear to dB.
the sin x/x plot work when using just "plot(x,y)" but now when trying to change the axis to dB and Freq.
;
댓글 수: 0
채택된 답변
Paul
2022년 11월 18일
Hi IFECHUKWU,
sin(x)/x can take on negative values, for example
x = 5*pi/4;
sin(x)/x
Taking the log10 (as neeed for dB, not log) of a negative number yields a complex result
log10(ans)
Not sure what kind of plot is expected after converting the result dB.
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Discrete Data Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!