Frequency granularity when writing Spectrum to CSV

Concerning processing components: filters, file load/save, visualizations, communication ...
Post Reply
ilja.kuzovkin
Posts: 16
Joined: Fri Sep 10, 2010 9:28 am

Frequency granularity when writing Spectrum to CSV

Post by ilja.kuzovkin »

I have following scheme
GDF Reader -> Temporal filter -> Time based epoching -> Spectral analysis -> CSV writer.
And I have two files: fileA (128Hz), fileB (256Hz).

When I process fileA in the CSV I get
Time - Channels - Min Freq - Max Freq
...... - ............ - 0 - 2
...... - ............ - 2 - 4
<etc>

And with fileB output is
Time - Channels - Min Freq - Max Freq
...... - ............ - 0 - 0.25
...... - ............ - 0.25 - 0.5
...... - ............ - 0.5 - 0.75
...... - ............ - 0.75 - 1
<etc>

I cannot figure out how I can control this "granularity"?
I mean how for example I can change output for fileB to be
Time - Channels - Min Freq - Max Freq
...... - ............ - 0 - 1
...... - ............ - 1 - 2
<etc>

yrenard
Site Admin
Posts: 645
Joined: Fri Sep 01, 2006 3:39 pm
Contact:

Re: Frequency granularity when writing Spectrum to CSV

Post by yrenard »

Dear ilja.kuzovkin,

the granularity of the Spectral analysis depends on the number of samples it receives as input. This is configured with the time based epoching and this behavior is directly related to the way Fast Fourier Transform (or FFT) is computed.

So for instance,
  • if the time based epoching builds up epochs of 1 second length, you should have 1 Hz granularity.
  • if the time based epoching builds up epochs of 2 seconds length, you should have 0.5 Hz granularity.
  • if the time based epoching builds up epochs of 0.5 seconds length, you should have 2 Hz granularity.
and so on...

The granularity is not related to the sampling rate of the input signal

Hope this helps,
Yann

Post Reply