Professional Documents
Culture Documents
Lab Report : 2
Tirthraj : 201901185
clc;
f=10;
a=2;
ts=0.001;
T=5;
t=0: ts:T;
y=a*sin(2*pi*f*t);
plot(t,y);
csvwrite("sine_discreat1.txt",y);
disp(length(y));
sinewave.c file :-
3) Result of simulation :
4) Conclution :
In this lab we have generated sine wave in
STM32407VGtx microcontroller. We have used two .c files
to generate sine wave. sinewave.c file contains samples of
sine wave of amplitude = 5 which we have generated
through MATLAB code. In the main file we have used this
samples to generate sine wave. Different to previous lab
we have added DSP in ‘Manage Runtime Environment’
which is used for mathematical calculations. We can
change amplitude and frequency by generating samples
accordingly from MATLAB file.