clear all
Fs = 1000; % sampling frequency
dt =1/Fs; % time increment
tfinal = 1 ; % time of measurement 1sec
time=0:dt:tfinal;
% My signal sum of 60Hz and 120Hz sin wave
y=sin(2*pi*120*time)+0.5*sin(2*pi*60*time);
L =length(time); % length of signal
SRC=zeros(1,L);
f=1/dt; % Maximum frequency
NFREQ = 1000;
FREQ = linspace(0,f,NFREQ);
% % INITIALIZE FOURIER TRANSFORMS
K = exp(-1i*2*pi*dt*FREQ);
for T = 1 : L
for nf = 1 : NFREQ
SRC(nf) = SRC(nf) + (K(nf)^T)*y(T);
end
end
% % FINISH FOURIER TRANSFORMS
SRC = SRC*dt;
plot(FREQ,abs(SRC(1:NFREQ)))
Fs = 1000; % sampling frequency
dt =1/Fs; % time increment
tfinal = 1 ; % time of measurement 1sec
time=0:dt:tfinal;
% My signal sum of 60Hz and 120Hz sin wave
y=sin(2*pi*120*time)+0.5*sin(2*pi*60*time);
L =length(time); % length of signal
SRC=zeros(1,L);
f=1/dt; % Maximum frequency
NFREQ = 1000;
FREQ = linspace(0,f,NFREQ);
% % INITIALIZE FOURIER TRANSFORMS
K = exp(-1i*2*pi*dt*FREQ);
for T = 1 : L
for nf = 1 : NFREQ
SRC(nf) = SRC(nf) + (K(nf)^T)*y(T);
end
end
% % FINISH FOURIER TRANSFORMS
SRC = SRC*dt;
plot(FREQ,abs(SRC(1:NFREQ)))
MATLAB Coding | matlabcoding.com pinned «join here with 27k people https://www.facebook.com/groups/MATLABCODES/»
MATLAB Coding | matlabcoding.com pinned «https://youtu.be/r1cu6Ann7R4»
Forwarded from Technical Expert
Do Rating for 100 Days Challenge videos Rating. Before rating do check this videos. this feedback helps alot for future videos. https://www.youtube.com/playlist?list=PLNhFkFk6qEgJ9g3RUR8PtnD_Rw2KmsAR1
Anonymous Poll
38%
5 : Excellent
18%
4: Best
23%
3: Good
14%
2: Okay
7%
1: Not useful
Forwarded from MATLABbot
New Matlab udate on matlabcoding.com : https://www.matlabcoding.com/2020/11/systems-engineering-part-5-some.html
MATLAB Programming
Systems Engineering, Part 5: Some Benefits of Model-Based Systems Engineering
Learn how model-based systems engineering (MBSE) can help you cut through the chaos of early systems development and get you from definition to execut