Chatper1-Topic-信号与线性系统(正式版)
时间:2026-01-14
时间:2026-01-14
Lecture1信号与系统基础本章主要内容: 傅里叶级数仿真 傅里叶变换仿真 功率和能量
【矩形信号串的傅里叶级数】
e.g.1.1
设周期为T0的周期信号x(t)定义为
其中按照惯例定义为:
。特例:矩形信II(t)
假设A=1,T0=4,t0=1,求: 1.分别用指数和三角函数展开的x(t)的傅里叶级数的系数; 2.画出x(t)的离散谱。
【求解过程】
1)周期信号x(t)的波形
2)根据傅里叶级数系数的求法,得:
【求解过程】(续1)
3)傅里叶级数的系数分开写成:
【matlab程序】
% MATLAB script for Illustrative Problem 1, Chapter 1.
n=[-20:1:20]; x=abs(sinc(n/2)); stem(n,x);
【matlab运行结果】1 0.9 0.8 0.7 0.6 0.5 0.4 0.3 0.2 0.1 0 -20
-15
-10
-5
0
5
10
15
20
图1.1离散谱
【运行结果说明】
问题?
书中P6图1.3如何用matlab实现?
clear; clc; N=9; t=[-2:0.01:2]; sum=0.5*ones(1,length(t)); for n=0:N xt=sinc((n/2))*cos(2*pi.*t*(n/4)); sum=sum+xt; plot (t,sum); hold on; end
运行结果2.2 2
1.8
1.6
1.4
1.2
1
0.8 -2
-1.5
-1
-0.5
0
0.5
1
1.5
2
【非规整信号串的傅里叶级数】
e.g.1.2信号x(t)如图:
求傅里叶级数的系数。
【matlab程序】
傅里叶级数系数的matlab程序:
function xx=fseries(funfcn,a,b,n,tol,p1,p2,p3)%FSERIES Returns the Fourier series coefficients.% It can depend on up to three parameters p1,p2, and p3. The function is given over one period extending from 'a' to 'b'% xx=vector of length n+1 of Fourier Series% Coefficients, xx0,xx1,...,xxn.% p1,p2,p3=parameters of funfcn.% tol=the error level.
【matlab程序】(续1)
j=sqrt(-1); args0=[]; for nn=1:nargin-5 args0=[args0,',p',int2str(nn)]; end args=[args0,')']; t=b-a; xx(1)=eval(['1/(',num2str(t),').*quad(funfcn,a,b,tol,[]',args]);
【matlab程序】(续2)
for i=1:n new_fun= 'exp_fnct'; args=[',', num2str(i), ',', num2str(t), args0, ')']; xx(i+1)=eval(['1/(',num2str(t),').*quad(new_fun,a, b,tol,[],funfcn',args]); end
【幅度谱和相位谱】
e.g.1.2求并画出周期为8, x(t)= (x),|t|<=4的信号离散幅度和相位谱。
【matlab程序】
% MATLAB script for Illustrative Problem 2, Chapter 1. echo on fnct='lambda'; a=-4; b=4; n=24;
【matlab程序】(cont.)
tol=0.1; xx1=xx(n+1:-1:2); xx1=[conj(xx1),xx]; absxx1=abs(xx1); xx=fseries(fnct,a,b,n,tol); pause% Press any key to see a plot of the magnitude spectrum.
上一篇:校园局域网规划设计
下一篇:新托福阅读核心词汇分类总结