help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Loading and operate multiples files


From: Priscilla
Subject: Loading and operate multiples files
Date: Mon, 25 Mar 2019 15:30:18 -0500 (CDT)

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!






--
Sent from: http://octave.1599824.n4.nabble.com/Octave-General-f1599825.html



reply via email to

[Prev in Thread] Current Thread [Next in Thread]