How to create a sine and triangle waves with frequency modulation of 0.5 Hz and peak to peak voltage is 4 V to -4 V at sample rate of 1 kHz ?

23 ビュー (過去 30 日間)
I have given a triangle and sin funtions from funtion generator but i only have information about voltage with different voltage values per cycle.
I tried to change the voltage but i couldn't do it
fs = 1000;
t = 0:1/fs:2;
x1 = sawtooth(2*pi*0.5*t,1/2);
x2 = sin(2*pi*0.5*t);
subplot(2,1,1)
plot(t,x1)
axis([0 2 -4 4])
xlabel('Time (sec)')
ylabel('Amplitude')
title('triangle Periodic Wave')
subplot(2,1,2)
plot(t,x2)
axis([0 2 -4 4])
xlabel('Time (sec)')
ylabel('Amplitude')
title('Sine Periodic Wave')
could you please suggest me how to do it

回答 (1 件)

Urmila Rajpurohith
Urmila Rajpurohith 2020 年 3 月 4 日
According to my understanding if you need sine and triangle waves with peak to peak voltage 4V to -4V you can try the following lines of code
x1 = 4*sawtooth(2*pi*0.5*t,1/2);
x2 = 4*sin(2*pi*0.5*t);
and for frequency modulation you can use "fmmod" function.
Please refer the following documentation for further information:
  1 件のコメント
sharanya medoji
sharanya medoji 2020 年 3 月 5 日
Thank you so much for suggest and info i will try it and can i ask you again if i have any other questions is that okay?

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeMathematics についてさらに検索

製品


リリース

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by