greg
greg

Reputation: 159

MATLAB sinc issue

I'm trying to plot the sinc function in the image below using the code below, but not getting it. Any suggestions?

enter image description here

X = -5:1/150:5;
Y = 2*150e6*pi*sinc(150e6*X);

Upvotes: 0

Views: 457

Answers (1)

Luis Mendo
Luis Mendo

Reputation: 112689

Try this:

hold all
c = 3e8; %// speed of light, m/s
x = -5:1/150:5;
t = x/c;
for B = [150e6 300e6 600e6]; %// bandwidth, Hz
    y = 2*pi*B*sinc(B*t);
    plot(x,y)
end
grid
legend('B = 150 MHz', 'B = 300 MHz', 'B = 600 MHz')
xlabel('$x = ct$','interpreter','latex')
ylabel('$2\pi B \mathrm{sinc}(Bt)$','interpreter','latex')

enter image description here

Upvotes: 2

Related Questions