How can i plot this signal?
109 次查看(过去 30 天)
显示 更早的评论
I have a signal like this v=240*sin(2*pi*f(t)*t) where f(t)=50+sin(t). My sampling frequency is 7500 Hz.How can i plot the above mentioned signal?I am getting an error while plotting.Expecting reply.
0 个评论
回答(3 个)
Image Analyst
2012-8-11
编辑:Image Analyst
2012-8-11
Did you try the straightforward, obvious approach that just uses your equations to get f and then v?
% Get the times between 1 andnumberOfSeconds, inclusive:
% (Adjust parameters as needed.)
numberOfSeconds = 9
samplingRate = 7500 % Samples per second.
numberOfSamples = samplingRate * numberOfSeconds
t = linspace(0, numberOfSeconds, numberOfSamples);
% Get f:
f =50 + sin(t);
% Get v:
v = 240 * sin(2*pi*f .* t);
% Plot:
plot(t, v);
% Enlarge figure to full screen.
set(gcf, 'units','normalized','outerposition',[0 0 1 1]);
2 个评论
Matt Fig
2012-8-11
That picture is misleading. Try with
linspace(1,4*pi,8000);
Then again with 80000!
Image Analyst
2012-8-11
Yeah, I know there's aliasing going on, but when I did it with just a few hundred samples, it looked like just a normal sine wave.
Azzi Abdelmalek
2012-8-11
编辑:Azzi Abdelmalek
2012-8-11
te=1/7500;
t=0:te:500*te;
f=50+sin(t);
v=240*sin(2*pi*f.*t);
plot(t,v)
3 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Audio I/O and Waveform Generation 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!