Blame view

psdplot.m 519 Bytes
45d0ff1fa   bmarechal   compute PSD from ...
1
2
3
4
5
6
7
  #!/usr/bin/octave-cli --persist
  
  filename = argv(){1};
  col = eval(argv(){2});
  mult = eval(argv(){3});
  
  if length(col) == length(mult)
1a0e88f0c   bmarechal   replace 4-spaces ...
8
9
10
11
12
13
14
15
16
17
18
19
20
21
  	figure
  	hold all
  	grid on
  	cc = 'bkcgmry';
  	for i = [1:length(col)]
  		data.freq = load(filename)(:,col(i)).*mult(i);
  		data.rate = 1;
  		[p, f] = pwelch(data.freq, [], 0.95, [], data.rate.*mult(i), 'onesided');
  		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   bmarechal   compute PSD from ...
22
23
  end
  exit