In MATLAB, generate a square wave of period 1s and length of 8s, sampled at 1024HZ. The maximum value of the wave is 1 and the minimum value is -1. Take the fft of this data. Show both plots. The fft should represent Fourier series representation of the wave in lecture, comment on this aspect. Comment on the difference in FFT when I sample for 8.01 sec instead of 8 sec.
clc;
clear all;
close all;
%%%%%%generation of square wave%%%%%%%%%%%%%
f=1; %frequency of square wave
Fs=1024; %sampling frequency
ts=1/Fs;
N=32*256; %we are using 256 point fft
t=0:ts:N*ts;
x=square(2*pi*f*t); %generating square wave
figure;
plot(t,x); %plotting square wave
xlabel('time');
ylabel('amplitude');
title('suqare wave');
%%%generating fourier transform
y=fft(x);
y=fftshift(y);
P2=abs(y/N);
P1 = P2(1:N);
P1(2:end-1) = P1(2:end-1);
f = Fs*((-N/2):(N/2-1))/N; %%%generating frequency
figure;
plot(f,P1);
title('N=256 point fft');
xlabel('frequency (Hz)');
ylabel('|X(f)|/N');
In MATLAB, generate a square wave of period 1s and length of 8s, sampled at 1024HZ. The maximum v...
Please Solve this Question anyway either by using MATLAB or any other way ..... QUESTION : Generate a square wave with peak as last 2 digits of your roll number. Find the overshoot value for this square wave. How many harmonics are required to generate this square wave with 9% overshoot. Find the overshoot when 101 harmonics are used. Find the overshoot when 401 harmonics are used. Exploit the effect of odd harmonics in generating a square wave. Draw necessary...