⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 fourierseries.m

📁 Program to plot x(t) =1/2+∑_(n=1)^∞&#9618 (sinc&#8289 〖n/2〗 〖 cos 〗&#8289 〖2πnt/4〗 ) Include n-
💻 M
字号:
clc;clear all;
i=1;

in=str2num(input('What is the n-limit: ','s'));

for t=-4:0.1:4
    v(i)=0.5;
    w(i)=t;
    for n=1:1:in        
        v(i)=v(i)+[sinc(n/2)*cos(2*pi*n*t/4)];
        %plot(t,v(i),'bo')
        %hold on        
    end       
        i=i+1;  
end

plot(w,v,'k')

text(-0.8, max(v)/2, sprintf('Value of n is %d',in));
%text(0,max(v),' \leftarrow Simulated Graph','FontSize',10)
%gtext('ATAUR RAHMAN')
hold on

squarewave1(in) %Original Graph
legend('Simulated Plot','Original Plot');
title('Understanding Sinusoidal Signal and Harmonics')
xlabel('Time - Plot')
ylabel('X(n) - Plot')
hold on
%grid on

%stem(w,v,'o')

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -