« first day (7 days earlier)      last day (53 days later) » 

7:18 AM
@A_A Idk how to get the timestamps externally, so I am using the timestamps obtained within the program...
@A_A Interestingly, after 985 frames, the program would crash... so probably the computation is not keeping up with the video... but that is something weird for a program that takes in one frame at a time... Anyway, I guess I have to optimize for real-time later on...
@A_A results for the prerecorded and loaded in video:
@A_A the 50 bpm signal is still prominent... maybe it's just a problem with the beginning of the video as some of the later data points seemed to print out the correct bpm but I wouldn't be able to say that for sure since the program crashed so soon! Anyway, I will see what I can do in that regard then...
 
A_A
7:39 AM
@TanMath Thank you. What is the trace of the crash? What is the crash due to?
 
@A_A huh? which plot?
 
A_A
@TanMath When a Python program crashes, it gives you some feedback on why the crash occured. What is the error message you get in your case?
 
@A_A oh it did not say anything as far as i can remember... I am using the spyder IDE... it was running, printing the bpm, and then all of a sudden, just did nothing... after 5-10 sec windows tels me python is not responding...
 
A_A
@TanMath Can you please do a python [yourscript.py] from outside of Spyder and note why this happens?
 
@A_A sure gimme 5 min...
@A_A ok i think i figured out the problem (maybe?)
@A_A for one, it doesn't give any message... running from the command line it seems technically the program isnt crashing... it actually just does nothing..
 
A_A
7:52 AM
@TanMath I have a few comments but I may write them in a reply on your post later today. In any case, I think that the jitter will be your biggest issue to solve. For starts
 
@A_A second of all, I noticed this time when running the code that the frames are going by really fast... so i probably have to put in some delay... but i'd say it defeats the purpose of the timestamps then...
 
A_A
@TanMath You are trying to estimate a periodic event and your jitter is worrying at times
@TanMath When you have jitter in the sampling frequency then everything is shifted up and down. Your bandpass filter cut off frequencies are going to be shifting etc
@TanMath And in addition to that you have a very challenging environment in terms of SNR
@TanMath So, what I would suggest to you is to start thinking about a real real-time solution which basically includes Multithreading
@TanMath You will need one thread devoted to data acquisition and then the main thread (or possibly another one) doing the processing
@TanMath The thread that is doing the acquisition will have to be programmed to be firing at set time intervals, which is something that you can specify in pyhton
@TanMath The ONLY thing that that thread will be doing is to capture a frame and note its timestamp. Nothing else
@TanMath Python has the `deque
@TanMath Python has the collections.deque data structure which is a FIFO queue and it is thread safe. You can have the deque being populated from one end by the capture thread and read from the other end by the data processing thread. It will handle blocking on its own
 
@A_A I have never done multi-threading before so I have couple questions...
@A_A "You can have the deque being populated from one end by the capture thread and read from the other end by the data processing thread. It will handle blocking on its own" could you explain?
 
A_A
@TanMath 1) Multithreading is not that difficult. It is like calling a function that runs AT THE SAME TIME as your main process.
@TanMath But, because now it is like having two different programs trying to access the same memory, you need to coordinate them so that they don't both try to access the same memory space at the same time
 
@A_A Ah ok, so you have to carefully time the functions?
@A_A btw how free are you in like 12 hours? it's 3am over here (out-of-town) so need to get to bed soon...
@A_A i am really sorry for leaving you in the middle of the conversation but I really need to head to bed... i hope I will be able to talk in (my) morning...
 
A_A
8:12 AM
@TanMath Give it a go. No worries I understand. If you use the deque, you don't have to handle all of the timing, will explain in more detail
 
@A_A ok thanks, will look into it in the morning... good night/morning! :P
 
 
11 hours later…
7:43 PM
@A_A hello... i was looking into multithreading for python, and i am not sure how it would work for using deque.... I found some stuff on like using a function map for threading, but it didn't make much sense.... I am still looking around for implementing multithreading in python
@A_A it seems that deque is a queue module or something? How does that help though?
 
 
2 hours later…
9:57 PM
@A_A by the way, in the future, is it possible to set up meetings with you? and maybe like a voice chat or something?
 

« first day (7 days earlier)      last day (53 days later) »