Monday, 1 April 2019

Matlab Discrete Sinusoid

2/4/2019 Creating Discrete Sinusoidal

I'm going to go learn Cyclic Spectroscopy for Radio Astronomy Applications. Got distracted, plotted Sinusoids in Matlab instead.

I think it looks pretty

a = -80;
b = 80;
n = a:b; %sample length
fs = 0.0125;
phi = 0;
Amp = 6;

x = Amp*sin(2*pi*fs*n - phi);
x2 = (-Amp)*x

clf
stem(n, x, '-o')
axis([0 b -2 2]);
grid;
title('sinusoid')
xlabel('Time index n')
ylabel('Amplitude')
axis

%plotting an evil twin
hold on

stem(n, x2, '-*')

No comments:

Post a Comment

Diaries of an Aspiring Astrophysicist (DAS Astro) Podcast

Diaries of an Aspiring Astrophysicist Episode 1: The last year has been weird Episode 2: Cosmic Collisions and Gravitational Wa...