Blame view

fftplot.m 627 Bytes
f89a1f519   bmarechal   change highpass f...
1
2
3
4
5
6
  #!/usr/bin/octave-cli --persist
  
  filename = argv(){1};
  col = eval(argv(){2});
  mult = eval(argv(){3});
  data.fs = eval(argv(){4});
4b03c7b92   bmarechal   add highpass cuto...
7
  f_hp = eval(argv(){5});
f89a1f519   bmarechal   change highpass f...
8

4b03c7b92   bmarechal   add highpass cuto...
9
  [b, a] = butter (3, f_hp, "high");
f89a1f519   bmarechal   change highpass f...
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
  
  if length(col) == length(mult)
  	figure
  	hold all
  	grid on
  	cc = 'bkcgmry';
  	for i = [1:length(col)]
  		data.x = filter(b, a, load(filename)(:,col(i)).*mult(i))(floor(end/4):end);
  		N = length(data.x);
  		f = (data.fs/N)*((-(N-1)/2):((N-1)/2));
  		X = abs(fftshift(ifft(data.x)));
  		plot(f, X, cc(mod(i, length(cc))))
  		leg{i} = strcat(filename, ' col', num2str(col(i)));
  		hold on
  	end
  	legend(leg)
  	input("Press to continue...");
  end
  exit