www.pudn.com > AR_MATLAB.rar > WienerFilter_Plot.m


% File: WienerFilter_Plot.m 
% ------------------------- 
% This file is used to draw the various plots 
 
function WienerFilter_Plot() 
 
load WienerFilter_SeqGen.mat; 
load WienerFilter_Core.mat; 
load WienerFiltering.mat; 
 
figure(); 
% Plots I 
% Plot the original signal s(n) and the input sequence x(n) for the last 
% 100 samples 
for i = 1: 100 
    signalvector_s_cast(i) = signalvector_s(400 + i); 
    signalvector_x_cast(i) = signalvector_x(400 + i); 
end 
 
index = [401: 1: L]; 
subplot(2, 2, 1); 
hold all; 
xlabel('400 \leq {\itn} \leq 500'); 
ylabel('Sample of Random Sequences'); 
title('Original Signal {\its(n)} vs. Input Sequence {\itx(n)}'); 
 
plot(index, signalvector_s_cast); 
plot(index, signalvector_x_cast);  
 
legend( 'Original Signal', 'Input Sequence'); 
grid off; 
hold off; 
 
% Plots II 
% Plot the ideal filter output and fir filter output for the last 100 
% samples 
for i = 1: 100 
    output_vector_fir_cast(i) = output_fir(400 + i); 
    output_vector_ide_cast(i) = output_ide(400 + i); 
end 
 
%index = [401: 1: L]; 
%subplot(2, 2, 2); 
%hold all; 
%xlabel('400 \leq {\itn} \leq 500'); 
%ylabel('Sample of Random Sequences'); 
%title('Ideal Filter Output{\its_I(n)} vs. FIR Filter Output{\its_R(n)}'); 
 
%plot(index, output_vector_ide_cast); 
%plot(index, output_vector_fir_cast);  
 
%legend( 'Ideal Filter Output', 'FIR Filter Output'); 
%grid off; 
%hold off; 
% Plot the ideal wiener filter and the fir wiener filter for N samples 
index = [1: 1: N]; 
subplot(2, 2, 2); 
hold all; 
xlabel('1 \leq {\itn} \leq N'); 
ylabel('Filter Samples'); 
title('Ideal Wiener Filter {\ith_I(n)} vs. FIR Wiener Filter {\ith_f(n)}'); 
 
plot(index, h_ide); 
plot(index, h_fir);  
 
legend( 'Ideal Filter', 'FIR Filter'); 
grid off; 
hold off; 
 
% Plots III 
% Plot the ideal filter output and the original signal for the last 100 
% samples 
index = [401: 1: L]; 
subplot(2, 2, 3); 
hold all; 
xlabel('400 \leq {\itn} \leq 500'); 
ylabel('Sample of Random Sequences'); 
title('Ideal Filter Output {\its_I(n)} vs. Original Signal {\its(n)}'); 
 
plot(index, signalvector_s_cast);  
plot(index, output_vector_ide_cast); 
 
legend('Original Signal', 'Ideal Filter Output'); 
grid off; 
hold off; 
 
% Plots IV 
% Plot the fir filter output and the original signal for the last 100 
% samples 
index = [401: 1: L]; 
subplot(2, 2, 4); 
hold all; 
xlabel('400 \leq {\itn} \leq 500'); 
ylabel('Sample of Random Sequences'); 
title('FIR Filter Output {\its_R(n)} vs. Original Signal {\its(n)}'); 
 
plot(index, signalvector_s_cast);  
plot(index, output_vector_fir_cast); 
 
legend( 'Original Signal', 'FIR Filter Output'); 
grid off; 
hold off; 
 
clear;