Variable Amplitude sine wave
显示 更早的评论
Hello, I am trying to learn some more about the function fft, for that I have a code like this
%Time specifications:
Fs = 1000; % samples per second
dt = 1/Fs; % seconds per sample
StopTime = 0.6; % seconds
t = (0:dt:StopTime-dt)'; % seconds
% Sine wave:
Fc = 500; % hertz
x = sin(2*pi*Fc*t);
% Plot the signal versus time:
figure;
plot(t,x);
xlabel('time (in seconds)');
title('Signal versus Time');
zoom xon;
Now I dont understand why, but the output of the plot is a sinusoidal wave that increases in amplitud. why is that? As far as my understanding goes, that should not happen. I know that it has something to do with the Fs value. but what is the relationship exactly. How should I pick a good Fs value to avoid this?
Thank you very much
1 个评论
Shravankumar P
2014-7-2
编辑:Shravankumar P
2014-7-2
you need to change the frequncy Fc ; try Fc=10 to 50 ;
or you need to change the Fs, eg: Fs=100000;
采纳的回答
更多回答(1 个)
Shravankumar P
2014-7-2
0 个投票
See this Attached file with Fc=10Hz
类别
在 帮助中心 和 File Exchange 中查找有关 Waveform Generation 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!