Generate single cycle of a sine wave at a particular frequency
126 ビュー (過去 30 日間)
古いコメントを表示
Hello, I need help generating a single cycle of a sinewave at a particular frequency and sampling rate. The following example generates multiple cycles and I am not sure how to get a single cycle.
fs = 512; % Sampling frequency (samples per second)
dt = 1/fs; % seconds per sample
StopTime = 0.25; % seconds
t = (0:dt:StopTime-dt)'; % seconds
F = 60; % Sine wave frequency (hertz)
data = sin(2*pi*F*t);
Thank you,
4 件のコメント
KEERTHANA VELUSAMY
2020 年 5 月 1 日
Could any one share matlab code for storing the signals data in 2 arrays of 64 elements
Gaurav Wadhai
2021 年 12 月 5 日
clc;
clear all;
close all;
L = 3; %Up-sampling factor
M = 2; %Down-sampling factor
n = 0:29;
x = sin(2*pi*0.43*n) + sin(2*pi*0.31*n);
y = resample(x,L,M);
subplot(2,1,1),stem(n,x(1:30));
xlabel('Time index n');
ylabel('Amplitude');
title('lnput Sequence');
m = 0:(30*L/M)-1;
subplot(2,1,2),stem(m,y(1:30*L/M));
axis([0 (30*L/M)-1 -2.2 2.21]);
xlabel('Time index n');
ylabel('Amplitude');
title('Output Sequence');
回答 (9 件)
KSSV
2016 年 10 月 27 日
fs = 512; % Sampling frequency (samples per second)
dt = 1/fs; % seconds per sample
StopTime = 0.25; % seconds
t = (0:dt:StopTime)'; % seconds
F = 60; % Sine wave frequency (hertz)
data = sin(2*pi*F*t);
plot(t,data)
%%For one cycle get time period
T = 1/F ;
% time step for one time period
tt = 0:dt:T+dt ;
d = sin(2*pi*F*tt) ;
plot(tt,d) ;
2 件のコメント
anasuya b
2018 年 1 月 11 日
I wante to make a sine wave . First donot know how to create vector how to create a vector for a sample data of 300 in 5 min time (300 sec) PL help
0 件のコメント
Fahad Hossen
2018 年 6 月 7 日
fs = 512; % Sampling frequency (samples per second) dt = 1/fs; % seconds per sample StopTime = 0.25; % seconds t = (0:dt:StopTime)'; % seconds F = 60; % Sine wave frequency (hertz) data = sin(2*pi*F*t); plot(t,data) %% For one cycle get time period T = 1/F ; % time step for one time period tt = 0:dt:T+dt ; d = sin(2*pi*F*tt) ; plot(tt,d) ;
0 件のコメント
Qammar Taskeen
2020 年 7 月 21 日
Generate the following signals in MATLAB using subplot command such that the x-axis title contains your UET (2 Fig Roll No.) and y-axis title contains your APCOMS (4 Fig Roll No) while the title of the plot shows your Name and Batch No. (CLO-01, PLO-5) (25 Marks)
- Sinusoid
- Kronecker Delta
- Unit step signal
- Ramp
Complex Exponential
0 件のコメント
Qammar Taskeen
2020 年 7 月 21 日
Demonstrate the designing of a circuit in MATLAB Simulink such that it represents the equation sin2 φ + cos2 φ = 1 where φ = UET (2 Fig Roll No.) the output should have an amplitude of 1 on the “scope”. Save the .mdl file and attach it in the online submission of this assignment. Also add its screenshot in the assignment.
0 件のコメント
Qammar Taskeen
2020 年 7 月 21 日
Demonstrate the generation of a Saw Tooth wave from its Fourier Series in MATLAB such that the x-axis title contains your UET (2 Fig Roll No.) and y-axis title contains your APCOMS (4 Fig Roll No) while the title of the plot shows your Name and Batch No.
0 件のコメント
Qammar Taskeen
2020 年 7 月 21 日
Find and Demonstrate the inverse Z-Transform of following. Here a and b are the two digits of your UET (2 Fig Roll No.) whereas c, d, e and f represent the 4-digits of your APCOMS (4 Fig Roll No).
0 件のコメント
Sanjay Talbar
2021 年 7 月 6 日
fs = 512; % Sampling frequency (samples per second)
dt = 1/fs; % seconds per sample
StopTime = 0.25; % seconds
t = (0:dt:StopTime-dt)'; % seconds
F = 60; % Sine wave frequency (hertz)
data = sin(2*pi*F*t);
0 件のコメント
HARSH VARDHAN
2024 年 1 月 22 日
Q1. Write A Matlab code
a) To Generate the following frequency signals and play as audio tones for each one second duration.
Sa
Re
Ga
Ma
Pa
Da
Ni
Sa
240Hz
270Hz
300Hz
320
360Hz
400Hz
450Hz
480Hz
b) To Create a variable to store the following tune and also play the audio tone for following sequences : Sa Re Sa Re| Sa Re Ga Ma| Sa Ni Sa NI |Sa Ni Da Pa
c) Also show the amplification and attenuation of the above generated tone
Q2. Write a Matlab code
a) to read the given input signal data from Microsoft Excel sheet and store the same.
b) to display the graph of above stored date.
c) to perform the following signal operations on the input signal
i. x(2t-1)
ii. 2*x(4+t)
iii. x(2-0.5t)
iv. (2/3)*x(2+0.5t)
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Multirate Signal Processing についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!