This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function [ao, bo, offset, y] = align(a, b) | |
| % align two signals a and b | |
| % ao and bo are aligned ones with same length | |
| % y is the correlation xcorr(a, b) | |
| % a_ind + offset -> b_ind | |
| % if offset >= 0, cut a, else cut b | |
| an = length(a); bn = length(b); | |
| N = max(an, bn); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function mkdir_if_not_exist(dirpath) | |
| if dirpath(end) ~= '/', dirpath = [dirpath '/']; end | |
| if (exist(dirpath, 'dir') == 0), mkdir(dirpath); end | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function segs = get_segments(o) | |
| segs = []; | |
| if o(1), st = 1; state = 1; | |
| else state = 2; end | |
| for i = 2 : length(o) | |
| if o(i) | |
| if state == 2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <alsa/asoundlib.h> | |
| #define BUF_BYTES 128 | |
| int main (int argc, char *argv[]) { | |
| int err; | |
| unsigned char buf[BUF_BYTES]; | |
NewerOlder