Blame view
psdplot.m
601 Bytes
45d0ff1fa compute PSD from ... |
1 2 3 4 5 |
#!/usr/bin/octave-cli --persist filename = argv(){1}; col = eval(argv(){2}); mult = eval(argv(){3}); |
bba038d14 add fs arg |
6 |
data.rate = eval(argv(){4}); |
c4b4eae8c psdplot.m: add n-... |
7 |
d = eval(argv(){5}); |
45d0ff1fa compute PSD from ... |
8 9 |
if length(col) == length(mult) |
1a0e88f0c replace 4-spaces ... |
10 11 12 13 14 |
figure hold all grid on cc = 'bkcgmry'; for i = [1:length(col)] |
c4b4eae8c psdplot.m: add n-... |
15 |
data.freq = diff(load(filename)(:,col(i)).*mult(i), d)*data.rate**d; |
88a86ac73 ... |
16 |
[p, f] = pwelch(data.freq, hanning(length(data.freq)/100), 0.5, [], data.rate, 'onesided', 'power'); |
1a0e88f0c replace 4-spaces ... |
17 18 19 20 21 22 |
semilogx(f, 10*log10(p), cc(mod(i, length(cc)))) leg{i} = strcat(filename, ' col', num2str(col(i))); hold on end legend(leg) input("Press to continue..."); |
45d0ff1fa compute PSD from ... |
23 24 |
end exit |