matlab code to convert continuous signal into its discrete form
Mostrar comentarios más antiguos
conversion from continuous to discrete form
2 comentarios
Azzi Abdelmalek
el 12 de Feb. de 2013
What do you mean? ploting?
Jagadeesh Talari
el 30 de Nov. de 2021
Code
Respuestas (3)
Azzi Abdelmalek
el 12 de Feb. de 2013
If you want to plot a discrete signal
x=1:10
y=sin(x)
stem(x,y)
4 comentarios
Nishank Gupta
el 12 de Feb. de 2013
Azzi Abdelmalek
el 12 de Feb. de 2013
Editada: Azzi Abdelmalek
el 12 de Feb. de 2013
What do you mean by continuous signal? give an example of a continuous signal. In your computer, both continuous and discrete signals are in a discrete form!
Nishank Gupta
el 12 de Feb. de 2013
Azzi Abdelmalek
el 12 de Feb. de 2013
Editada: Azzi Abdelmalek
el 12 de Feb. de 2013
You said: "i want a signal as output whose sample difference is 1 unit"
My question is, you want an output from what? Give an example. Or do you want to create a discrete signal?
Azzi Abdelmalek
el 12 de Feb. de 2013
Editada: Azzi Abdelmalek
el 12 de Feb. de 2013
Maybe you want quantizing
% your original signal
t=0:0.1:10
y=2*sin(t)
plot(y,'r')
% Quantizing
q=1 % quantization interval
yd=round(y/q)*q
hold on
plot(yd,'b')
4 comentarios
naadiya khudabux
el 3 de Mayo de 2016
hi .. i have the same question i want to do sampling at 50 Hz .how can i do ??
Walter Roberson
el 3 de Mayo de 2016
num = xlsread('HASC24278-acc.csv');
timestamps = num(:,1);
signals = num(:,2:end);
first_time = timestamps(1);
last_time = timestamps(end);
Fs = 50;
period = datenum([0 0 0 0 0 1/Fs]);
probe_times = first_time : period : last_time;
resampled_data = interp1(timestamps, signals, probe_times);
naadiya khudabux
el 9 de Mayo de 2016
Editada: Walter Roberson
el 18 de Mayo de 2016
1.3608 1.3608 1.3608 1.3608 1.3608 1.3608 1.3608
Columns 7367746 through 7367752
1.3608 1.3608 1.3608 1.3608 1.3608 1.3608 1.3608
Columns 7367753 through 7367759
1.3608 1.3608 1.3608 1.3608 1.3608 1.3608 1.3608
Columns 7367760 through 7367766
its stuck :(.. not working with me .
Walter Roberson
el 18 de Mayo de 2016
num = csvread('HASC24278-acc.csv');
timestamps = datetime( num(:,1), 'convertfrom', 'posixtime');
signals = num(:,2:end);
first_time = timestamps(1);
last_time = timestamps(end);
Fs = 50;
period = seconds(1/Fs);
probe_times = first_time : period : last_time;
resampled_data = interp1(timestamps, signals, probe_times);
However, this will fail because you have duplicate timestamps at line 1222 and 1223:
1360805282.336 -0.20259 -0.797522 0.41063
1360805282.336 -0.201619 -0.701036 0.350918
peter dalton
el 18 de Mayo de 2016
0 votos
i also have a same problem . actually i have a plot of (E,N_E), both are the matrices of of different dimensions, since i am developing a user interface so everytime these dimensions will get change. if i want to plot (dN_E/dE,E), how do i plot this?
1 comentario
Walter Roberson
el 18 de Mayo de 2016
Categorías
Más información sobre Time Series Objects en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!