Professional Documents
Culture Documents
Document
Document
clear all;
close all;
if strcmp(rec, x)
wr = ones(1, N);
figure(1);
subplot(221);
stem(n, wr, 'red');
set(gca, 'fontname', 'Times New Roman');
title('{\it Rectangular Window}', 'fontweight', 'bold', 'fontsize', 14);
xlabel('\color{darkgreen}{\it n}', 'fontweight', 'bold', 'fontsize', 12);
ylabel('\color{darkgreen}{\it Wrec(n)}', 'fontweight', 'bold', 'fontsize', 12);
elseif strcmp(tri, x)
wtri = 1 - (abs(2*n - N + 1) / (N - 1));
subplot(222);
stem(n, wtri, 'blue');
set(gca, 'fontname', 'Times New Roman');
title('{\it Triangular Window}', 'fontweight', 'bold', 'fontsize', 14);
xlabel('\color{darkgreen}{\it n}', 'fontweight', 'bold', 'fontsize', 12);
ylabel('\color{darkgreen}{\it Wtri(n)}', 'fontweight', 'bold', 'fontsize', 12);
elseif strcmp(ham, x)
wham = 0.54 - 0.46 * cos((2 * pi * n) / (N - 1));
subplot(223);
stem(n, wham, 'green');
set(gca, 'fontname', 'Times New Roman');
title('{\it Hamming Window}', 'fontweight', 'bold', 'fontsize', 14);
xlabel('\color{darkgreen}{\it n}', 'fontweight', 'bold', 'fontsize', 12);
ylabel('\color{darkgreen}{\it Wham(n)}', 'fontweight', 'bold', 'fontsize', 12);
elseif strcmp(han, x)
whan = 0.5 - 0.5 * cos((2 * pi * n) / (N - 1));
subplot(224);
stem(n, whan, 'magenta');
set(gca, 'fontname', 'Times New Roman');
title('{\it Hanning Window}', 'fontweight', 'bold', 'fontsize', 14);
xlabel('\color{darkgreen}{\it n}', 'fontweight', 'bold', 'fontsize', 12);
ylabel('\color{darkgreen}{\it Whan(n)}', 'fontweight', 'bold', 'fontsize', 12);
elseif strcmp(all, x)
wr = ones(1, N);
figure(1);
subplot(221);
stem(n, wr, 'red');
set(gca, 'FontName', 'Times New Roman');
title('Rectangle window', 'fontweight', 'bold', 'fontsize', 14);
xlabel('\color{darkgreen}n', 'fontsize', 12);
ylabel('\color{darkgreen}wr', 'fontsize', 12);
hold on;