how do Create a message signal m(t) = cos(2πfmt), fm = 5 KHz. and Plot the signal both in time domain and the magnitude of its spectrum in frequency domain?
12 ビュー (過去 30 日間)
古いコメントを表示
how do Create a message signal m(t) = cos(2πfmt), fm = 5 KHz. and Plot the signal both in time domain and the magnitude of its spectrum in frequency domain?
My code is below for time domain
>> fm = 5000;
>> t = 0: 0.01: 10;
>> y = cos(2*pi*fm*t)
>> plot(t,y)
I just get a straight line???
0 件のコメント
回答 (5 件)
Rick Rosson
2013 年 3 月 31 日
編集済み: Rick Rosson
2013 年 3 月 31 日
The sampling rate that you are using is 100 samples per second, whereas the carrier frequency of the message signal is 5,000 hertz. According to the Nyquist Sampling Theorem, you need a sampling rate that is at leat twice the highest frequency that you want to represent. So, in this example, you need a sampling rate of at least 10,000 samples per second.
Let's try 800,000 samples per second, and see if it helps:
Fs = 800e3;
dt = 1/Fs;
t = (0:dt:0.002-dt)';
Fm = 5000;
y = cos(2*pi*Fm*t);
figure;
plot(t,y);
2 件のコメント
Ankit Ghosh
2017 年 8 月 20 日
I think it is the other way round. May you please check if my understanding is wrong or you mistyped ?
Ankit Ghosh
2017 年 8 月 20 日
編集済み: Ankit Ghosh
2017 年 8 月 20 日
fs = 1e3;
dt = 1/fs;
t = (0:0.001:10)';
fm = 2e3;
sig = sin(2*pi*fm/fs*t);
plot(t,sig);
title('sin wave with 1KHz sampling rate')
This is working perfectly fine for me as per the text book equations.
RISET
2017 年 1 月 15 日
編集済み: RISET
2017 年 1 月 15 日
as fm =5000 ; so (fm*t)=an integer; for cos(2*pi*n) value is always=0; so try to change it to some other values like 4999 or 3479 or 23 or 5 ;yes for fm = 5947; t = 0: 0.01:1; y = cos(2*pi*fm*t); plot(t,y) u will see the graphs cosine nature is lost it is due to the t intervals u have taken .try to change them as small as possible ....like fm = 5947; t = 0: 0.001:.1; y = cos(2*pi*fm*t); plot(t,y) u will see what u want....{i have not maintained the desired frequency but try to conceptualise what nyquist rate leading towards)...
0 件のコメント
Jayram Naykinde
2021 年 10 月 25 日
perform Sampling of a signal
clc;
clear all;
close all;
f0=3;
fs=10;
T=1/f0;
t=0:0.001:5*T;
x_t=cos(2*pi*3*t);
Ts=1/fs;
n=0:Ts:5*T;
x_n=cos(2*pi*f0*n);
subplot(2,1,1)
plot(t,x_t,'-.');
xlabel('Time')
ylabel("x(t)")
subplot(2,1,2) stem(n,x_n,"filled"); xlabel('Time') ylabel("x(n)")
0 件のコメント
azad Thanveer
2022 年 6 月 2 日
>> fm = 5000; >> t = 0: 0.01: 10; >> y = cos(2*pi*fm*t) >> plot(t,y)
0 件のコメント
azad Thanveer
2022 年 6 月 2 日
fm = 5000;
>> t = 0: 0.01: 10;
>> y = cos(2*pi*fm*t)
>> plot(t,y)
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Spectral Measurements についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!