Answered step by step
Verified Expert Solution
Question
1 Approved Answer
please use sawtooth as a second signal .. Option 1: Signal Approximation using Fourier Series 1.1 Description Fourier series is a method used to approximate
please use sawtooth as a second signal ..
Option 1: Signal Approximation using Fourier Series 1.1 Description Fourier series is a method used to approximate a periodic signal. One of the common Fourier series forms is the cosine-sine form. Given a signal named f(t) with a period T, the signal f(t) can be approximated using the following formula: f(t)a0+n=1(ancos(T2nt)+bnsin(T2nt)) Where a0=T10Tf(t)dtan=T20Tf(t)cos(T2nt)dt,n1bn=T20Tf(t)sin(T2nt)dt,n1 1.2 Task: Your task is to create a MATLAB function that calculates the Fourier series of periodic signal. You will also be required to test your function on multiple signals. Use the following instructions as a guide. 1. Create a MATLAB function named fseries according to the following guidelines: Syntax: [F,e]=fseries(f,T,N) Inputs: f= one period of the signal f(t) for 0tT T= the time-period of the signal N= the upper limit for n in the approximation Outputs: F= Fourier series approximation of f(t) e= mean absolute percentage error 2. Use the function square to create a signal named y1(t) consisting of one complete cycle of a square wave signal with a period of T=2. Use a suitable increment for the time array t. 3. Test the fseries function with the signal y1(t) once with N=10 and once with N=100. Use disp to display the mean absolute percentage error for both cases, each clearly labeled. 4. Use subplot to plot the original signal and the two approximations. 5. Repeat steps 2-4 but with a different periodic signal of your choice Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started