Generate single cycle of a sine wave at a particular frequency
580 次查看(过去 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) ;
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 中查找有关 Switches and Breakers 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!