labstreaminglayer / App-g.Tec

6 stars 2 forks source link

gUSBamp filter configuration #4

Open cboulay opened 5 years ago

cboulay commented 5 years ago

From @delozath on February 25, 2016 14:22

Hello everyone,

I've been searching in forums and code examples, but I haven't figured out how to configure the hardware filters of the g.USBamp using the lsl\Apps\g.Tec\g.USBamp app. I guess, it is related to the .cgf file. Does anybody have some idea?

Thank you in advanced!

_Copied from original issue: sccn/lslarchived#94

cboulay commented 5 years ago

This code segment shows that the filters are disabled by default. I searched the repository for any other mention of GT_SetBandPass and there was none other than the vendor-supplied header file. I guess the LSL app is not yet capable of setting the filters, though it shouldn't be too difficult.

The simplest solution for you would be to hard code which filter type you want to use by replacing the -1 with the filter number.

The second-easiest solution would require several modifications:

  1. Add a ui element like this one for storing the filter number as an integer.
  2. Modify how the config files are read and saved to use the filter number ui element.
  3. During initialization, somewhere around here, read the filter number from the ui into an int.
  4. During filter setup, replace the -1 with the int filter number in the call to GT_SetBandPass.

Also do the above for GT_SetNotch while you're at it.

This will set all channels to use the same bandpass and notch filter types.

Probably the better long-term solution would be to create a table widget with a row for each channel and columns corresponding to channel_label, band_pass_filter_id, notch_filter_id, is_bipolar, is_DRL

I don't have access to a g.USBamp and coding these things without hardware to test on is pretty difficult.

cboulay commented 5 years ago

From @chkothe on February 29, 2016 22:47

Hi delozath, is there a pressing need to enable these filters in hardware?

Because, as long as you only record the data you could easily do it in software later (and probably better, plus you can always go back to the raw data), and if you do real-time processing then that processing app could probably apply the filters in software, too.

cboulay commented 5 years ago

From @emolyzr on February 8, 2018 11:3

Hi @cboulay

I made some changes in the mainwindow.cpp file, ... set some Bandpass and Notch Filters. However, when starting the app these changes did not have an effect. Do I need to compile something new? And if so, could you explain how to do that? I have no experience with coding in C#.

cboulay commented 5 years ago

@emolyzr , Actually I'm working on a new g.tec g.NEEDaccess app that can handle g.Nautilus, g.USBamp(s), and g.HIamp. The g.Nautilus support is done. The g.USBamp support is mostly there. It just needs a little GUI work for setting the filters. The g.HIamp works in a bit of a convoluted way, but that's being worked on to make it easier. I hope to push a new version by the end of tomorrow.

https://github.com/sccn/labstreaminglayer/tree/master/Apps/g.Tec/g.NEEDaccess

cboulay commented 5 years ago

From @emolyzr on February 8, 2018 18:34

Wow! Perfect timing! Right now, I am using the app from the ftp server with my g.USBamp and face some problems. Namely the amp crashes after a couple of minutes. I don't have the problem with my MATLAB API based script, so I think it is a software not a hardware issue. I am very looking forward to the release of the new app. Maybe it will heal me from my sufferings ;) Thanks for your great work!

cboulay commented 5 years ago

Hi @emolyzr ,

I just pushed 9b2f950e173d44d674445cb09838700e633d8d7d . This improves support for the g.USBamp in the g.NEEDaccess client application. I'm testing with 2 amps in master/slave and it appears to be working... but I don't have the time right now to test if the filter settings are correct, etc. Please test the filters before you do anything in production with this. I will try to get back to this next week.