TUM-Logo

libRASCH

 

Home
 

General

About libRASCH/News
Design
Screen shots
Sample programs (with source code)
License
 

Download

libRASCH
Tools
 

Documentation

User
Developer
 

Resources

Mailing list
Supported Formats
Plugins
Status
Links
 
Contact
About this site
 
Last updated
Tue Mar 27 23:03:50 2007
Get Sample Data

3.4. Get Sample Data

The example will show how to get the root recording and some information about it. We will perform the following steps:

  • get root recording

  • get some general informations about the recording

  • get some infos about all used recording devices

  • get some infos about all recorded channels

When more than one recording device was used, the root recording provides access to the channels as if they were recorded with one device.

rasch@rasch:~> octave
GNU Octave, version 2.1.50 (i686-pc-linux-gnu).
...

octave:1> ra=ra_lib_init
ra = 145017272
octave:2> meas=ra_meas_open(ra, '/home/rasch/ecgs/AT011030_rdi.ART', 0)
meas = 145244336
octave:3> rec=ra_rec_get_first(meas, 0)
rec = 145421120
octave:4> num_ch=ra_rec_get_info(rec, 'rec_num_channel')
num_ch = 5
octave:5> ch_all=[];
octave:6> for i=0:(num_ch-1)
> ch=ra_raw_get(rec, i, 0, 10000); (1)
> ch_all=[ch_all ch'];
> endfor
octave:7> whos ch_all

*** local user variables:

prot  type                       rows   cols  name
====  ====                       ====   ====  ====
 rwd  matrix                    10000      5  ch_all

octave:8> samplerate=ra_ch_get_info(rec, 0, 'ch_samplerate')
samplerate = 1600
octave:9> x=0:9999;
octave:10> x = x / samplerate;
octave:11> figure(0); plot(x, ch_all(:,1));
octave:12> figure(1); plot(x, ch_all(:,2));
octave:13> figure(2); plot(x, ch_all(:,3));
octave:14> figure(3); plot(x, ch_all(:,4));
octave:15> figure(4); plot(x, ch_all(:,5));
octave:16>
(1)
Returns 10,000 samples for channels 0..4, starting with sample 0 in each channel.

Figure 3-1 shows a screenshot of Octave after performing the above steps. Each plot window on the right side shows a recording channel. The x-axis is in seconds.

Figure 3-1. Screenshot after performing the commands in Octave as shown in the Octave session above (and on the left side in the screenshot).