Algorithm expertise
Intervals and containers
- Current frequency intervals (Hz):
01: [0..1]
02: [1..2]
03: [2..4]
04: [4..8]
05: [8..16]
06: [16..32]
07: [32..64]
08: [64..128]
09: [128..256]
10: [256..512]
11: [512..1024]
12: [1024..2048]
13: [2048..4096]
14: [4096..8192]
15: [8192..16384]
16: [16384..32768]
-
Inside these 16 intervals 2 containers are defined:
0..127
(low-container, 8 intervals) и128...32768
(high-container, also 8 intervals); -
Low-container collects neural oscillations (or brainwaves) frequencies.
-
High-container collects collects piano key frequencies and is compatible ( ±200 Hz ) with frequency values of contra-octave, great octave, small octave, ..., 5-line octave.
Current algorithm behaviour
-
Input file should be resampled to 32768 Hz sample rate. It's critical because algorithm is based on 1 Hz frequency resolution and FFT size is set to 32768.
-
Data frame is N samples from input file for FFT processing (N = FFT size). For example, if 4:26 seconds length file with sample rate 32768 is given, there will be 8716288 total samples and time frame will be 1 second.
-
For the data frame algorithm calculates 8 frequency points:
01: sum(20*log10([0..1]))/1 + sum(20*log10([128..256]))/128
02: sum(20*log10([1..2]))/1 + sum(20*log10([256..512]))/256
03: sum(20*log10([2..4]))/2 + sum(20*log10([512..1024]))/512
04: sum(20*log10([4..8]))/4 + sum(20*log10([1024..2048]))/1024
05: sum(20*log10([8..16]))/8 + sum(20*log10([2048..4096]))/2048
06: sum(20*log10([16..32]))/16 + sum(20*log10([4096..8192]))/4096
07: sum(20*log10([32..64]))/32 + sum(20*log10([8192..16384]))/8192
08: sum(20*log10([64..128]))/64 + sum(20*log10([16384..32768]))/16384
Warnings on this implementation
Intervals should be tuned according to neural oscillations and piano key frequencies:
01: [0..3] - delta wave
02: [4..5] - low theta wave
03: [6..7] - high theta wave
04: [8..13] - alfa wave
05: [14..16] - beta wave, 1 power
06: [17..20] - beta wave, 2 power
07: [21..28] - beta wave, 3 power
08: [29..63] - gamma wave
09: [64..127] - great octave
10: [128..255] - small octave
11: [256..511] - 1 octave
12: [512..1023] - 2 octave
13: [1024..2047] - 3 octave
14: [2048..4095] - 4 octave
15: [4096..8191] - 5 octave
16: [8192..16384] - special/noi effects
Explicit mathematical model
- Current algorithm version calculate 1 average frequency points for the interval, as shown above there is 8 frequency points for time frame.
While recovering amplitude-time waveform with frequencies under 64 Hz (high limit of neural oscillations frequencies - NOF) via inverse FFT (iFFT) we should process 2*NOF elements vector in accordance with Nyquist–Shannon–Kotelnikov.
- Regarding previous paragraph: we need 128 elements frequency array to recover 1 second time frame (it should be proved on MATLAB model).
Suggestions
-
Prove paragraph no.2 from Mathematical model;
-
Test different cases of frequency array filling;
2.1 Create 16 (128/8) datasets with 8 elements length and all elements of each dataset will filled with single value of frequency point with the same index.
2.2 Create 8 various-length datasets and fill each dataset with single value of frequency point with the same index:
01: [0..3] - delta wave
02: [4..5] - low theta wave
03: [6..7] - high theta wave
04: [8..13] - alfa wave
05: [14..16] - beta wave, 1 power
06: [17..20] - beta wave, 2 power
07: [21..28] - beta wave, 3 power
08: [29..63] - gamma wave