OtterVIS LGL meets OCTAVE

In order to test the  OtterVIS I connected the output of it to the math software GNU Octave. This program has a lot of advantages: 

  • compatible to MATLAB
  • good documentation
  • a large community
  • you can create scripts for repetitive tasks
  • and its free
Find the Peak

There is an interesting web site about signal processing in scientific measurements. One sub section is concerned with peak finding in data. I adjusted the script to meet my needs. (findpeaks.m)

How to use the scripts
  1. Make a nice record by tweaking the SH und ICG-period.
  2. Save the record (no baseline | no Absorbtion (still under construction) | enable Save in[nm]). e. g. test.dat in the spectra directory.
  3. Open octave and navigate to the spectra directory. (e.g. ls shows you where you are)
  4. type ovis_peaks(„test.dat“,3900,1,1) and hit return.

The script ovis_peaks needs the filename, zero value, autoleveling on / off, display details and plot file on/off.  It uses the findpeaks.m script to do the work. The output is a plot, a jpeg-file and a description of the peaks found.

Check repeated Measurements

To allow multiple exposures and keep the redraw functional I implemented a timer. The parameter of the timer can be configured by a dialog. The record are saved in the form name-no_of_exposure-seconds.dat.

How to check a repetative single peak 
  1. Make a nice record of e.g. laser with a single peak by tweaking the SH und ICG-period. (no baseline, no absorbtion, enable save[nm]). 
  2. Answer die multple exposure dialog. E. g. 10 exposures, after 30 sec the next record and filename starts with „532“. 
  3. Press the red record button and wait until the measurements are done. This will generate a sequence of files: 532-0-0.dat, 532-1-30.dat, 532-2-60.dat  etc.
  4. Open octave and navigate to the spectra directory. 
  5. type repro(„532-*.dat“,3900,1) and hit return.

The pictures show the result of two collections of multiple exposures. I used two lasers with 405nm uns 650nm. The 405nm records showed always one peak at the nearly the same mark. The 650nm laser records sometimes displayed a second peak.

 

 

 

 

 

8 Gedanken zu „OtterVIS LGL meets OCTAVE“

  1. Hi,

    My name is Marcus Grassi and I am a student studying Mechanical Engineering in California. I am currently attempting to build a refractometer to test BRIX content of grapes for my senior design project. I was wondering if I would be able to use the scripts you wrote to collect data with GNU octave? I cannot seem to find them on your blog. I am attempting to implement Esben’s solution for operating the CCD TCD1304 but have been struggling to get an output signal read on the computer. I would appreciate any help. Thank you for your time!

    Best Regards,

    Marcus Grassi

    1. Hi Marcus,
      thank you for your response. Perhaps I wasn’t clear enough. The octave-scripts use csv-files as input.
      You can check this by downloading the older otterly-raman-gui-jfs.tar from my spetroscopy-page.
      Extract it, open Octave and move to the spectra directory. In the directory you will find data to play with.
      For example: ovis_peaks(„405-0-0.dat“,3900,1,1).
      Perhaps you can give me more information about the problem with the connection of the TCD1304 with your computer.
      [photo, operation system, uart or spi ..]

      Best Regards,

      Jens-Ulrich Fröhlich

  2. Hello ,
    My name is Omar Mohd and I’m a sophomore Biomedical engineer at North Carolina State University, I was wondering if the Raspberry pi can support the new UART version of your software, rather than using SPI? I’m trying to make a linear displacement sensor, and basically trying to get a .dat or .excel file that shows the pixel number vs intensity, I tried Esben Rossel’s setup , but I was wondering if there is a way to save more than one .dat file, since I need to get multiple reading, and I would love to know how to use your octave script, I know how to use MATLAB but im not good with C programming . Thank you

  3. Hello,
    Its Omar again,
    Im pretty new to using linux, but when I downloaded your GUI file for the UART, and then I executed the command „make“ I got :’make: nothing to be done for ‚all‘.
    So I assumed that the folder came pre-compiled, but when I tried to to run the ‚OTTERLY-CCD-GUI‘ executable nothing would happen? I tried Esben’s version of the GUI as well and the same thing happened. When I used the raspberry pi version using SPI instead of UART it worked perfectly, I just don’t really know what I am doing wrong. I outputted the .bin file to the stm32f401re, and I made sure all the environmental setup was in order ( I downloaded the Firmware, peripherals, and gcc cross-compiler )
    can you please help me, I think I’m making some stupid mistake but not realizing it.
    Thank you

    1. Hi Omar,
      I am not an expert in Linux or C so please be patient. The UART-version was developed unter Ubuntu 16.04. on a PC.
      So try this
      – after you downloaded the software and entered the main directory: cd src | touch main.c | cd .. | make
      – now the compiler will give you an error cause by the wrong libkplot.a library
      – so edit the Makefile at $(PROJECT_NAME): $(SRCS)
      $(CC) $(CFLAGS) $(WFLAGS) $^ -o $@ $(GTKFLAGS) libkplot.a -lm
      and replace libkplot.a with libkplot_rpi.a and save.
      – run make and the compiler will show only some warnings
      – sudo ./Otterly-CCD-GUI should now work

      Best regards
      Jens-Ulrich Fröhlich

  4. Hello,
    It’s Omar again,
    thank you for the quick response! I followed your instructions, and the GUI now launches, however when I click the record button, the GUI automatically exits and shows no errors or warning, the other features work just fine, such as setting the integration value , etc.
    when I launch the GUI this is the cli output that I get:

    (Otterly-CCD-GUI:2344): Gtk-WARNING **: Could not load image
    ‚otter-bw.png‘: Failed to open file
    ‚/home/pi/otterly-raman-gui/otter-bw.png‘: No such file or directory
    get 405nm.dat
    min 1778 bei 576
    get 650nm.dat
    min 1573 bei 2486
    delta 245.000000127nm -> 7.795918 start 331.115173
    get 405nm.dat
    redraw

    —Thank you again for taking the time to read my comments

    1. p.s.
      I tried it with esben’s GUI ,and when it crashed as well, the terminal said :Segmentation fault
      which could be related to the previous warning outputed when I changed libkplot.a to libkplot_rpi.a

    2. Hi Omar,
      I am not sure where the problem is. The Output you sent me is ok. You can check the program by starting it and
      – check yauto and [nm]
      – open and read the e.g. kv_0001m.dat
      – and an old spectrum should be visible
      this should work without the spectrometer connected.
      Be sure that you copied F401_FW_TCD1304.bin file from mar17-TCD1304-uart to the Nucleo-Board

      Best Regards
      Jens-Ulrich Fröhlich

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert.