On Mon, Mar 25, 2019 at 6:53 PM Priscilla Neves <
address@hidden> wrote:
I'm sorry, I thought the messages had not been sent. My bad.
Em seg, 25 de mar de 2019 às 19:45, Doug Stewart <
address@hidden> escreveu:
Hello!
I have been working on a project involving the Picoscope signal
(oscilloscope).
I've made the code below to load the 32 files generated by the Picoscope and
cut those signals in a specific range (1500 - 5000), and it's working.
But now, I need to do some mathematical operations using these files, like
calculate the RMS and the area below the graph of the accumulated
amplitudes. So I made this code:
--------
clear
pkg load signal
#Loading the 32 files
for i = 1:32
str= strcat(sprintf("pcb 0_%02d.mat", i));
load(str)
#Cut the signal
Aa = A(1500:5000);
#Aa=Aa-mean(Aa);
step=200;
plot (Aa)
hold on
#Convert to RMS
Ac=0;
i=1;
for index=1:step:(5000-step)
Ab(i)=rms(Aa(index:index+step))-mean(Aa(index:index+step));
#Accumulate the amplitudes
Ac(i+1)=Ac(i)+Ab(i);
i=i+1
end
end
--------
But it is not working...I don't know what is wrong...
Thank you for your help!
If you want the rms of Aa thendo:
q=rms(Aa)
First ---> slowdown don't post it 3 times!
rms fill work on the full vector at once, not index by index.
--
DAS
![Certificate for 206392 Certificate for 206392]()
--
Atenciosamente,
Priscilla Neves
Engenheira Ambiental Mestranda em Saneamento, Meio Ambiente e Recursos Hídricos- UFMG
tel: 55 31 999616346
Paz e Bem!