File:Gate sequence (frequency).pdf

Summary

Description
English: Gate sequence in frequency.
Italiano: Sequenza porta in frequenza.
Date
Source Own work
Author Luca Ghio
Permission
(Reusing this file)
Public domain I, the copyright holder of this work, release this work into the public domain. This applies worldwide.
In some countries this may not be legally possible; if so:
I grant anyone the right to use this work for any purpose, without any conditions, unless such conditions are required by law.
Category:Self-published work#Gate%20sequence%20(frequency).pdfCategory:PD-self#Gate%20sequence%20(frequency).pdf
gnuplot source
InfoField
click to expand
N=11;
n=[0:N-1];
x=ones(1,N);
r1=0.8;
r2=0.5;
r3=0.2;
h1=r1.^n;
h2=r2.^n;
h3=r3.^n;
figure
set (gca,'FontSize',14)
stem(n,x)
xlabel('n')
ylabel('x(n)')
axis([0 10 0 2])
grid on
figure
set (gca,'FontSize',14)
stem(n,h1)
xlabel('n')
ylabel('h_1(n)')
axis([0 10 0 1])
grid on
figure
set (gca,'FontSize',14)
stem(n,h2)
xlabel('n')
ylabel('h_2(n)')
axis([0 10 0 1])
grid on
figure
set (gca,'FontSize',14)
stem(n,h3)
xlabel('n')
ylabel('h_3(n)')
axis([0 10 0 1])
grid on

N=11;
n=[0:N-1];
x=ones(1,N);
r1=0.8;
r2=0.5;
r3=0.2;
k1=(1-r1)/(1-r1^N);
k2=(1-r2)/(1-r2^N);
k3=(1-r3)/(1-r3^N);
h1=k1*r1.^n;
h2=k2*r2.^n;
h3=k3*r3.^n;
%  figure
%  set (gca,'FontSize',14)
%  stem(n,x)
%  xlabel('n')
%  ylabel('x(n)')
%  axis([0 10 0 2])
%  grid on
%  figure
%  set (gca,'FontSize',14)
%  stem(n,h1)
%  xlabel('n')
%  ylabel('h_1(n)')
%  axis([0 10 0 1])
%  grid on
%  figure
%  set (gca,'FontSize',14)
%  stem(n,h2)
%  xlabel('n')
%  ylabel('h_2(n)')
%  axis([0 10 0 1])
%  grid on
%  figure
%  set (gca,'FontSize',14)
%  stem(n,h3)
%  xlabel('n')
%  ylabel('h_3(n)')
%  axis([0 10 0 1])
%  grid on

f=linspace(-0.5,0.5,1000);
H1=k1*(1-(r1*exp(-j*2*pi*f)).^N)./(1-r1*exp(-j*2*pi*f));
H2=k2*(1-(r2*exp(-j*2*pi*f)).^N)./(1-r2*exp(-j*2*pi*f));
H3=k3*(1-(r3*exp(-j*2*pi*f)).^N)./(1-r3*exp(-j*2*pi*f));
figure
set (gca,'FontSize',14)
plot(f,abs(H1))
hold on
plot(f,abs(H2),'r')
plot(f,abs(H3),'g')
xlabel('f')
ylabel('|H_i(e^{j\omega})|')
axis([-0.5 0.5 0 1.5])
grid on
legend('|H_1(e^{j\omega})|','|H_2(e^{j\omega})|', '|H_3(e^{j\omega})|')

N = 11;
X = (sin(pi*f*N) ./ sin(pi*f)) .* exp(-j*pi*f*(N-1));
figure
set (gca,'FontSize',14)
plot(f,abs(X))
xlabel('f')
ylabel('|X(e^{j\omega})|')
axis([-0.5 0.5 0 11])
grid on

Y1 = X .* H1;
Y2 = X .* H2;
Y3 = X .* H3;
figure
set (gca,'FontSize',14)
plot(f,abs(Y1))
hold on
plot(f,abs(Y2), 'r')
plot(f,abs(Y3), 'g')
xlabel('f')
ylabel('|Y_i(e^{j\omega})|')
axis([-0.5 0.5 0 11])
grid on
legend('|Y_1(e^{j\omega})|','|Y_2(e^{j\omega})|', '|Y_3(e^{j\omega})|')

N=11;
n=[0:N-1];
x=ones(1,N);
r1=0.8;
r2=0.5;
r3=0.2;
k1=(1-r1)/(1-r1^N);
k2=(1-r2)/(1-r2^N);
k3=(1-r3)/(1-r3^N);
h1=k1*r1.^n;
h2=k2*r2.^n;
h3=k3*r3.^n;
y1=conv(x,h1);
y2=conv(x,h2);
y3=conv(x,h3);
n=[0:length(y1)-1];
figure
set (gca,'FontSize',14)
stem(n,y1)
xlabel('n')
ylabel('y_1(n)')
axis([0 20 0 1.5])
grid on
figure
set (gca,'FontSize',14)
stem(n,y2)
xlabel('n')
ylabel('y_2(n)')
axis([0 20 0 1.5])
grid on
figure
set (gca,'FontSize',14)
stem(n,y3)
xlabel('n')
ylabel('y_3(n)')
axis([0 20 0 1.5])
grid on
This chart image could be re-created using vector graphics as an SVG file. This has several advantages; see Commons:Media for cleanup for more information. If an SVG form of this image is available, please upload it and afterwards replace this template with {{vector version available|new image name}}.
It is recommended to name the SVG file “Gate sequence (frequency).svg”—then the template Vector version available (or Vva) does not need the new image name parameter.
Category:Graph images that should use vector graphics#%20Gate%20sequence%20(frequency).pdfCategory:PDF that should be converted to SVG Category:Images with Octave source code Category:Created with GNU Octave Category:DFT vs DCT
Category:Created with GNU Octave Category:DFT vs DCT Category:Graph images that should use vector graphics Category:Images with Octave source code Category:PD-self Category:PDF that should be converted to SVG Category:Self-published work