time-frequency analysis
time-frequency analysis
I wish to replicate a time-frequency analysis using a continuous wavelet transform (CWT) which produces a running estimate of the spectrum at each time sample. Is there an existing Box or combination of Boxes that could do something similar?
Thanks,
-Jeff
Thanks,
-Jeff
Re: time-frequency analysis
I have had no replies yet. Does no one use continuous time-frequency analysis?
-Jeff
-Jeff
Re: time-frequency analysis
Hi Jeff,
I don't know if you've seen it already, but there is a Continuous Wavelet Analysis box in OpenViBE.
Here its documentation page: http://openvibe.inria.fr//documentation ... lysis.html
Hope this helps,
Thomas
I don't know if you've seen it already, but there is a Continuous Wavelet Analysis box in OpenViBE.
Here its documentation page: http://openvibe.inria.fr//documentation ... lysis.html
Hope this helps,
Thomas
Re: time-frequency analysis
Perfect, I had not found this before.
I mocked up a test scenario, but do not know how to display or save the results to a file for review.
-Jeff
I mocked up a test scenario, but do not know how to display or save the results to a file for review.
-Jeff
Re: time-frequency analysis
The output of the CWT analysis is compatible with the StreamedMatrix stream type.
Therefore you can write each of the outputs of the Continuous Wavelet Analysis box by connecting it to a CSV File Writer box (for a human readable output), or any other file writer box.
The thing is that the file writer boxes are set to receive Signal on their input by default (pink arrow). You can modify this by right clicking on the file writer box, and navigating to: inputs->1: InputStream->configure. In the configure box that pops up, you can change the stream type to StreamedMatrix.
Once the change is applied, the color of the input should change to green, and it can be connected to the Continuous Wavelet Analysis box outputs.
Hope this helps,
Thomas
Therefore you can write each of the outputs of the Continuous Wavelet Analysis box by connecting it to a CSV File Writer box (for a human readable output), or any other file writer box.
The thing is that the file writer boxes are set to receive Signal on their input by default (pink arrow). You can modify this by right clicking on the file writer box, and navigating to: inputs->1: InputStream->configure. In the configure box that pops up, you can change the stream type to StreamedMatrix.
Once the change is applied, the color of the input should change to green, and it can be connected to the Continuous Wavelet Analysis box outputs.
Hope this helps,
Thomas
Re: time-frequency analysis
Thomas,
This all worked as you described. Here is the current scenario: For this iteration I just selected the "smoking pic" epochs. I ran it but of course it used all the epochs and created huge CSV files that I could not open. How would I go about just selecting one epoch?
I used the default settings of Morlet wavelets and changed the highest frequency to 80 Hz, and the frequency spacing to 1.0. That was not acceptable, so I put the freq-spac back to 12.6 and got no complaint. I need to compare these parameters to the Matlab version I was using.Do you happen to know what the definition of the frequency spacing parameter is?
I see that I can use Doc_BoxAlgorithm_InstantBitmap3DStream to visualize the results, so I will try that.
-Jeff
This all worked as you described. Here is the current scenario: For this iteration I just selected the "smoking pic" epochs. I ran it but of course it used all the epochs and created huge CSV files that I could not open. How would I go about just selecting one epoch?
I used the default settings of Morlet wavelets and changed the highest frequency to 80 Hz, and the frequency spacing to 1.0. That was not acceptable, so I put the freq-spac back to 12.6 and got no complaint. I need to compare these parameters to the Matlab version I was using.Do you happen to know what the definition of the frequency spacing parameter is?
I see that I can use Doc_BoxAlgorithm_InstantBitmap3DStream to visualize the results, so I will try that.
-Jeff
- Attachments
-
- test_CWT.xml
- (29.75 KiB) Downloaded 1328 times
Re: time-frequency analysis
Addendum - where do I find documentation on the Doc_BoxAlgorithm_InstantBitmap3DStream?
-Jeff
-Jeff
Re: time-frequency analysis
Hi Jeff,
I see the epochs are generated on the OVTK_StimulationId_Number_03 stimulation. I guess there are quite a few in the data file.
If you want the CWT to be calculated on the first epoch only, you could put in place a mecanism to stop the scenario when reaching the second epoch.
To do so, you can add the "Stimulation Validator" box and a "Player Controller" box, with the following connections and settings:
Here is Instant Bitmap 3D Stream box documentation, but this one is really not helpful unfortunately.
And for the frequency spacing parameter of the CWT, I honestly do not know. Have you looked at the paper cited at the very end of the documenation page ?
Hope this helps,
Thomas
I see the epochs are generated on the OVTK_StimulationId_Number_03 stimulation. I guess there are quite a few in the data file.
If you want the CWT to be calculated on the first epoch only, you could put in place a mecanism to stop the scenario when reaching the second epoch.
To do so, you can add the "Stimulation Validator" box and a "Player Controller" box, with the following connections and settings:
- Stimulation Validator:
- input: connected to the stimulation output of the generic stream reader
- output: connected to the input of the Player Controller box
- setting Stimulation to count:OVTK_StimulationId_Number_03
- setting Number for validation: 2
- Player Controller box:
- input: connected to Stimulation Validator output
- setting Stimulation Name: OVTK_StimulationId_Number_03
- setting Action to perform: Stop
Here is Instant Bitmap 3D Stream box documentation, but this one is really not helpful unfortunately.
And for the frequency spacing parameter of the CWT, I honestly do not know. Have you looked at the paper cited at the very end of the documenation page ?
Hope this helps,
Thomas
Re: time-frequency analysis
Hi Thomas,
I think I did the steps correctly, and here is what happened: -Jeff
I think I did the steps correctly, and here is what happened: -Jeff
Re: time-frequency analysis
Forgot the scenario XML.
-Jeff
-Jeff
- Attachments
-
- test_CWT.xml
- (26.26 KiB) Downloaded 1277 times
Re: time-frequency analysis
Hi Jeff,
What I can see from your screenshot is that the pipeline was too demanding and the real-time was not managed.
I tested the scenario on some data I have here, with 96 channels, but could not reproduce the latency issue.
What sampling frequency are you using in your data acquisition ?
Would you be able to share the EEG file you used to run the scenario ?
Thanks,
Thomas
What I can see from your screenshot is that the pipeline was too demanding and the real-time was not managed.
I tested the scenario on some data I have here, with 96 channels, but could not reproduce the latency issue.
What sampling frequency are you using in your data acquisition ?
Would you be able to share the EEG file you used to run the scenario ?
Thanks,
Thomas
Re: time-frequency analysis
Hi Thomas,
Thanks for responding last Friday. I was travelling so was not able to respond until now. I created a test file that is shorter than the one I tried before. Two versions were created - OpenViBE and BrainVIsion. Here is a DropBox download link for the OV version. I examined the BV version in EEGlab, and it has 15 trials and lasts about 147 seconds. Sample rate of 500 frames/sec.
https://www.dropbox.com/scl/fo/iuxmy5qg ... 93tai&dl=0
-Jeff
Thanks for responding last Friday. I was travelling so was not able to respond until now. I created a test file that is shorter than the one I tried before. Two versions were created - OpenViBE and BrainVIsion. Here is a DropBox download link for the OV version. I examined the BV version in EEGlab, and it has 15 trials and lasts about 147 seconds. Sample rate of 500 frames/sec.
https://www.dropbox.com/scl/fo/iuxmy5qg ... 93tai&dl=0
-Jeff
Re: time-frequency analysis
Hi Jeff,
Despite the time delay, the process went through and the csv file was created.
However, the CSV file seems to be corrupted and I could not open it.
There reason it is happening is the because the file you are playing is already epoched and there are gaps between the epochs, and re-epoched again the scenario... I didn't have time to dig more, but I wouldn't be sure of the result of such epoching mechanisms.
It would be better to play a continuous data file, and apply the epoching needed in the scenario only.
Kind regards,
Thomas
Despite the time delay, the process went through and the csv file was created.
However, the CSV file seems to be corrupted and I could not open it.
There reason it is happening is the because the file you are playing is already epoched and there are gaps between the epochs, and re-epoched again the scenario... I didn't have time to dig more, but I wouldn't be sure of the result of such epoching mechanisms.
It would be better to play a continuous data file, and apply the epoching needed in the scenario only.
Kind regards,
Thomas
Re: time-frequency analysis
see my reply to the other thread