MATLAB Answers

Translated by

이 페이지의 내용은 영어에서 자동 번역되었습니다. 자동 번역 기능을 해제하려면 "<a class="turn_off_mt" href="#">여기</a>"를 클릭하십시오.

kacha m
0

Sawtooth and square wave generation

Asked by kacha m
on 5 Dec 2018
P = 1e-3;
n = 200;
Ts = P/n;
x = 0:Ts:P-Ts;
f = 1/P;
y = cos(2 * pi * f * x);
y=y*2^7;
y=fix(y);
plot(x,y)
I need to generate waves for a project am doing with VHDL. I used the above code to get the sine wave with 200 points and the period (1e-3). I want to do the same for sawtooth and square waves but not sure what am doing wrong. When i try to edit the above code to fit the sawtooth and square i just get a straight line. What do i change to generate the sawtooth and the square?
Thanks in advance

  0 Comments

Sign in to comment.

0 Answers


Translated by