Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Fs=8;
- T=1/Fs;
- t=0:T:(1-T);
- f=1;
- x=sin(2*pi*f*t);
- up_factor=2;
- %% Deduce sinc from Fourier domain
- xp=[zeros(1,5) x zeros(1,5)];
- Xp=fft(xp);
- door1D=abs(xp>0);
- sinc1D=fftshift(abs(fft(door1D)));
- %plot(door1D);hold on;plot(fftshift(abs(sinc1D)))
- %% Interp with sinc in spatial domain
- x_up=upsample(x,2);
- %plot(x,'b*');hold on;plot(x_up,'r*');
- x_up_interp=conv2(x_up,sinc1D,'same');
- figure;
- plot(x_up_interp./up_factor);
- hold on;
- plot(x);
- hold on;
- plot(x_up,'r+');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement