how i using three di↵erent window lengths (i.e., 1 second, 20 seconds, 100 seconds). Plot, and comment on the results. What happens as you increase the window length?

13 views (last 30 days)
%==================================================
% Sinusoidal signal with two frequencies
%==================================================
f1 = 0.5; % 1 Hz component
f2 = 2.5; % 2.5 Hz component
fs = 5*f2; % Sampling Frequency
T = 1/fs; % Sampling Period
n = 0:30*fs; % Plot 30 seconds
k = n*T; % Time Index
xs = 3*sin(2*pi*f1.*k) + 2*sin(2*pi*f2.*k);
subplot(3,2,1);
h = plot(k,xs); set(h, 'Markersize', 15);
ylabel('x(nT)'); box off;
axis tight;

Answers (1)

Abhishek Ballaney
Abhishek Ballaney on 15 Feb 2018
https://en.wikipedia.org/wiki/Window_function

Categories

Find more on Graphics Objects in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!