標(biāo)題: MATLAB波形和合成-原創(chuàng)資料 [打印本頁]
作者: hdfree 時(shí)間: 2023-7-29 17:26
標(biāo)題: MATLAB波形和合成-原創(chuàng)資料
請(qǐng)看波形和合成MATLAB R2016a 軟件M代碼
N=1024; % 采樣點(diǎn)數(shù)
T=2;x=linspace(0,T,N); %在0~T均勻產(chǎn)生N個(gè)點(diǎn)
y=sin(2*3.14*x)+1/3*sin(3*2*3.14*x);2個(gè)正弦波合成
subplot(221); %顯示格式
plot(x,y); %繪圖
axis([0,2,-1,1]); %坐標(biāo)
title('圖1 2次諧波合成'); %主標(biāo)簽
xlabel('時(shí)間'); %X標(biāo)簽
ylabel('幅值'); %Y標(biāo)簽
%11個(gè)正弦波合成
y=sin(2*3.14*x)+1/3*sin(3*2*3.14*x)+1/5*sin(5*2*3.14*x)...
+1/7*sin(7*2*3.14*x)+1/9*sin(9*2*3.14*x)+1/11*sin(11*2*3.14*x);
subplot(222);plot(x,y); axis([0,2,-1,1]);
title('圖2 11次諧波合成');
xlabel('時(shí)間');
ylabel('幅值');
解讀圖1 ,可知 2次諧波合成的信號(hào)可取向方波或三角波。
解讀圖2 ,可知 增加諧波次數(shù)可合成方波。
改變參數(shù)會(huì)發(fā)現(xiàn)同頻率正弦波合成的振幅和初相位會(huì)改變。
原理與公式:
-
1.png
(51.85 KB, 下載次數(shù): 278)
下載附件
2023-7-29 17:25 上傳
| 歡迎光臨 (http://m.raoushi.com/bbs/) |
Powered by Discuz! X3.1 |