how do you Calculate the amplitude of the signal for a period of 1 second
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
hi
3 Kommentare
Adam
am 14 Dez. 2017
And what is your problem with doing it? People aren't (usually) going to just do it for you without you showing any effort.
Antworten (1)
Harish Ramachandran
am 20 Dez. 2017
Bearbeitet: Harish Ramachandran
am 20 Dez. 2017
This is a very trivial implementation of calculating max / min values of signal amplitude (sine in this case) at a particular time interval. This should be a good starting point to customize for your purpose.
step = 0.2; %step for time
ll = 0; %lower limit of time
ul = 5; %upper limit of time
t = ll:step:ul; %time function
f = sin(t); %sine function for reference - can be replaced with your equivalent
interval = 1; %get max and min at interval (default = 1)
x = 1:(interval/step):max(size(f)); %calculate the indices when the switch in indices to the next interval will happen
for i=1:1:max(size(x))-1 %loop through and obtain the mx and mn values
mx(i) = max(f(x(i):1:x(i+1)-1));
mn(i) = min(f(x(i):1:x(i+1)-1));
end
mx and mn contain the values of the maximum and minimum values at time (0:1:5)
Henceforth while posting a question, please provide details of the use case and your initial effort. Thank you.
0 Kommentare
Siehe auch
Kategorien
Mehr zu Data Import and Analysis 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!