
%
% viewdat -d35:25 -mb All.T04 > FFT.txt
%
Spec = load('FFT.txt');

i = find(Spec(:,2) == 1.585e9); % Zeppelin/Progeny
if(length(i) == 0)
  i = find(Spec(:,2) == 1.590e9); % Polaris
  if(length(i) == 0)
    i = find(Spec(:,2) == 1.583e9); % Polaris
  end
end

centerFreq = Spec(i(1),2);
binWidth = Spec(i(1),3)*1e-3;
timeTag = Spec(i,1);
FFT = Spec(i,5:end);
[rows cols] = size(FFT);
centerIdx = round(cols / 2);
freq = ((1:cols) - centerIdx)*binWidth + centerFreq*1e-6;
figure
mesh(timeTag,freq,FFT')
colormap('jet')
colorbar
view(90,90)
xlabel('Time [Sec]');
ylabel('Freq MHz');
zlabel('Power [dB]');
title('L1');
print -dpng L1.png
view(90,0)
print -dpng L1-Analyzer.png
view(45,45)
print -dpng L1-Analyzer2.png

i = find(Spec(:,2) == 1.235e9); % Zeppelin/Progeny
if(length(i) == 0)
  i = find(Spec(:,2) == 1.240e9); % Polaris
end
centerFreq = Spec(i(1),2);
binWidth = Spec(i(1),3)*1e-3;
timeTag = Spec(i,1);
FFT = Spec(i,5:end);
[rows cols] = size(FFT);
centerIdx = round(cols / 2);
freq = ((1:cols) - centerIdx)*binWidth + centerFreq*1e-6;
figure
mesh(timeTag,freq,FFT')
colormap('jet')
colorbar
view(90,90)
xlabel('Time [Sec]');
ylabel('Freq MHz');
zlabel('Power [dB]');
title('L2');
print -dpng L2.png
view(90,0)
print -dpng L2-Analyzer.png
view(45,45)
print -dpng L2-Analyzer2.png


i = find(Spec(:,2) == 1.185e9); % Zeppelin/Progeny
if(length(i) == 0)
  i = find(Spec(:,2) == 1.190e9); % Polaris
end
centerFreq = Spec(i(1),2);
binWidth = Spec(i(1),3)*1e-3;
timeTag = Spec(i,1);
FFT = Spec(i,5:end);
[rows cols] = size(FFT);
centerIdx = round(cols / 2);
freq = ((1:cols) - centerIdx)*binWidth + centerFreq*1e-6;
figure
mesh(timeTag,freq,FFT')
colormap('jet')
colorbar
view(90,90)
xlabel('Time [Sec]');
ylabel('Freq MHz');
zlabel('Power [dB]');
title('L5');
print -dpng L5.png
view(90,0)
print -dpng L5-Analyzer.png
view(45,45)
print -dpng L5-Analyzer2.png

% B1
i = find(Spec(:,2) == 1.550e9); % Polaris
if(length(i) > 0)
  centerFreq = Spec(i(1),2);
  binWidth = Spec(i(1),3)*1e-3;
  timeTag = Spec(i,1);
  FFT = Spec(i,5:end);
  [rows cols] = size(FFT);
  centerIdx = round(cols / 2);
  freq = ((1:cols) - centerIdx)*binWidth + centerFreq*1e-6;
  figure
  mesh(timeTag,freq,FFT')
  colormap('jet')
  colorbar
  view(90,90)
  xlabel('Time [Sec]');
  ylabel('Freq MHz');
  zlabel('Power [dB]');
  title('B1');
  print -dpng B1.png
  view(90,0)
  print -dpng B1-Analyzer.png
  view(45,45)
  print -dpng B1-Analyzer2.png
end

% E6
i = find(Spec(:,2) == 1.280e9); % Polaris
if(length(i) > 0)
  centerFreq = Spec(i(1),2);
  binWidth = Spec(i(1),3)*1e-3;
  timeTag = Spec(i,1);
  FFT = Spec(i,5:end);
  [rows cols] = size(FFT);
  centerIdx = round(cols / 2);
  freq = ((1:cols) - centerIdx)*binWidth + centerFreq*1e-6;
  figure
  mesh(timeTag,freq,FFT')
  colormap('jet')
  colorbar
  view(90,90)
  xlabel('Time [Sec]');
  ylabel('Freq MHz');
  zlabel('Power [dB]');
  title('E6');
  print -dpng E6.png
  view(90,0)
  print -dpng E6-Analyzer.png
  view(45,45)
  print -dpng E6-Analyzer2.png
end

% S
i = find(Spec(:,2) == 2.503e9); % Polaris
if(length(i) > 0)
  centerFreq = Spec(i(1),2);
  binWidth = Spec(i(1),3)*1e-3;
  timeTag = Spec(i,1);
  FFT = Spec(i,5:end);
  [rows cols] = size(FFT);
  centerIdx = round(cols / 2);
  freq = ((1:cols) - centerIdx)*binWidth + centerFreq*1e-6;
  figure
  mesh(timeTag,freq,FFT')
  colormap('jet')
  colorbar
  view(90,90)
  xlabel('Time [Sec]');
  ylabel('Freq MHz');
  zlabel('Power [dB]');
  title('S1');
  print -dpng S1.png
  view(90,0)
  print -dpng S1-Analyzer.png
  view(45,45)
  print -dpng S1-Analyzer2.png
end
