function demo_sig1()
clear

clf
close all
fname='s5.wav';


start=20000; %starting location (sample) 
frame_size=1024; % one frame
[x_windowed,x_raw,fs]=read_x1(fname,start,frame_size);
size(x_windowed)
size(x_raw)
%%fill in you code from here
size(x_raw)
'you may use x\_windowed for assignments'

%%%%% answer to be filled %%%%%%%






%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% get data for assignments: 57074.1, you may use 
% matlab online: https://ww2.mathworks.cn/en/products/matlab-online.html 
% https://ww2.mathworks.cn/en/support/learn-with-matlab-tutorials.html
function [x_windowed,x_raw,fs]=read_x1(fname,start,frame_size)


[sig,fs]=audioread(fname);%x=data,fs=sampling_rate,nbits=num_bits
sound(sig,fs);%you can listen to the sound

x_raw=sig(:,1); %get one channel from stereo sound incase it is stereo
x_frame=x_raw(start:start+frame_size-1);
figure(1)
plot(x_frame)
ylabel("x raw")
xlabel("time samples")

figure(2)
clf
subplot(3,1,1);
hamm=hamming(frame_size);
plot(x_frame)
ylabel("x\_raw")
xlabel("time samples")

subplot(3,1,2);
hamm=hamming(frame_size);
plot(hamm)
ylabel("hamming")
xlabel("time samples")

subplot(3,1,3);

x_windowed=hamm.*x_frame;
plot(x_windowed)
ylabel("x\_frame windowed")
xlabel("time sample")

'you may use x1\_frame (windowed) and s\_all for assignments'




