Created
July 26, 2017 03:22
-
-
Save stephenHartzell/24653b91ffb005827c4aa802904762e6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% The reference signal | |
yref = [ones(1,56),zeros(1,200)]; | |
% Initialize movie | |
v = VideoWriter('test.avi','Uncompressed AVI'); | |
v.FrameRate = 10; | |
open(v) | |
figure('Position',[100 100 850 600]) | |
MF(1) = sum(yN.*yref); | |
subplot(2,1,1), plot(yref+4,'g') | |
title('Shift and Sum') | |
hold on | |
plot(yN,'r') | |
plot(y,'--','color',[0 0 0]) | |
set(gca,'xticklabel',[]) | |
xlim([1,256]) | |
ylim([-3,6]) | |
legend('Ref Signal','Noisey Signal','Burried Signal') | |
hold off | |
subplot(2,1,2), plot(MF,'m') | |
xlim([1,256]) | |
title('Matched Filter Output') | |
set(gca,'NextPlot','replacechildren'); | |
for j = 1:length(yref) | |
MF(j) = sum(yN.*circshift(yref',j)'); | |
% Initialize movie | |
subplot(2,1,1), plot(circshift(yref',j)+4,'g') | |
title('Shift and Sum') | |
hold on | |
plot(yN,'r') | |
plot(y,'--','color',[0 0 0]) | |
set(gca,'xticklabel',[]) | |
xlim([1,256]) | |
ylim([-3,6]) | |
legend('Ref Signal','Noisey Signal','Burried Signal') | |
hold off | |
subplot(2,1,2), plot(MF,'m') | |
xlim([1,256]) | |
title('Matched Filter Output') | |
frame = getframe(gcf); | |
writeVideo(v, frame.cdata); | |
end | |
close(v) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment