How can I create a signal that contains the sum of two cosine waves of equal amplitude at 40 Hz and 45 Hz
24 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Ömer Sertt
am 5 Nov. 2018
Kommentiert: Batuhan Osman Aynaci
am 15 Nov. 2021
The sampling rate must be 1 kHz
0 Kommentare
Akzeptierte Antwort
Stephan
am 5 Nov. 2018
Bearbeitet: Stephan
am 5 Nov. 2018
fs = 1000; % Sampling rate 1000 Hz = 1 kHz
t = 0:1/fs:1; % take a sample of 2 seconds with 1 kHz sampling rate
f1 = 40; % Frequency 1
f2 = 45; % Frequency 2
omega_1 = 2*pi*f1; % omega 1
omega_2 = 2*pi*f2; % omega 2
result = cos(omega_1.*t) + cos(omega_2.*t); % calculate sum
plot(t,result) % plot results
4 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Array and Matrix Mathematics finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!