Home > comms > sidelobes_cw_ms.m

sidelobes_cw_ms

PURPOSE ^

tried to cut out the non-relevant data first, but that causes the

SYNOPSIS ^

This is a script file.

DESCRIPTION ^

 tried to cut out the non-relevant data first, but that causes the
 solution not to work
[d_noise, d_off, indNoise] = cutNoise(d);
indSource = bitsearch(d_off.array.frame.features, 0, 'only');
d_src = framecut(d_off, indSource);

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 % tried to cut out the non-relevant data first, but that causes the
0002 % solution not to work
0003 %[d_noise, d_off, indNoise] = cutNoise(d);
0004 %indSource = bitsearch(d_off.array.frame.features, 0, 'only');
0005 %d_src = framecut(d_off, indSource);
0006 
0007 [d_noise, d_off, indNoise] = cutNoise(d);
0008 indSource = bitsearch(d.array.frame.features, 0, 'only');
0009 indSource = interp1(d.array.frame.utc, indSource, d.antenna0.receiver.utc, 'closest');
0010 indSource = indSource & ~indNoise;
0011 indSource(isnan(indSource)) = 0;
0012 
0013 
0014 data = d.antenna0.receiver.data(:,1);
0015 elevation = d.antenna0.servo.el;
0016 azimuth   = d.antenna0.servo.az;
0017 
0018 
0019 d2 = read_arc('11-Mar-2010:22:07:17', '11-Mar-2010:22:57:40');
0020 d2_length = length(d2.antenna0.receiver.utc);
0021 data = d2.antenna0.receiver.data(9500:d2_length,1);
0022 elevation = d2.antenna0.servo.el(9500:d2_length);
0023 azimuth   = d2.antenna0.servo.az(9500:d2_length);
0024 
0025 %d_fft = fft(data(1:2^18));
0026 %
0027 %d_powerspec = abs(d_fft).^2;
0028 %
0029 %fitted_sine = fit(transpose(1:length(data)),data,'sin1', 'Startpoint', [5 0.0754 0]);
0030 
0031 
0032 
0033 %x = transpose(1:length(data));
0034 %
0035 %d_square = square(2*pi*(x-38)*0.70072/100);
0036 %
0037 %d_sine = sin(2*pi*(x-38)*0.70072/100);
0038 
0039 
0040 % March 11, 2010.  CW without secondary baffle.
0041 switch_freq = 0.70072;
0042 switch_phase = 38;
0043 
0044 % March 11, 2010.  CW with secondary baffle.
0045 switch_freq = 0.70088;
0046 switch_phase = 61;
0047 
0048 
0049 
0050 n_meas = floor(length(data) / 100 * switch_freq);
0051 
0052 
0053 % On is defined as where (x-2)*0.70072/100 is equal to an integer.
0054 
0055 x_on = floor(100*(1:n_meas) / switch_freq + (switch_phase - 25 / switch_freq));
0056 x_off = x_on + floor(50 / switch_freq);
0057 
0058 
0059 diff_array = zeros(n_meas-2,1);
0060 elevation_array = zeros(n_meas-2,1);
0061 azimuth_array   = zeros(n_meas-2,1);
0062 on_source       = zeros(n_meas-2,1);
0063 
0064 
0065 for i=1:n_meas-2
0066 %for i=1:100
0067      
0068     on_mean = mean(data((x_on(i+1)-10):(x_on(i+1)+10)));
0069     off_mean_1 = mean(data((x_off(i)+1):(x_off(i)+16)));
0070     off_mean_2 = mean(data((x_off(i+1)-16):(x_off(i+1)-1)));
0071    
0072     
0073     difference = -(on_mean - 0.5*off_mean_1 - 0.5*off_mean_2);
0074     
0075     diff_array(i) = difference;
0076     
0077     elevation_array(i) = mean(elevation(x_on(i+1)-15:x_on(i+1)+15));
0078     azimuth_array(i)   = mean(azimuth(x_on(i+1)-15:x_on(i+1)+15));
0079     
0080     on_source(i) = mean(indSource(x_on(i+1)-15:x_on(i+1)+15))>0.8;
0081 end
0082 
0083 on_source = on_source > 0;  % turn it into a logical array
0084 f = find(azimuth_array > 180);
0085 elevation_array(f) = 180 - elevation_array(f);
0086 
0087 plot(elevation_array(on_source), diff_array(on_source));
0088 xlabel('Elevation angle from horizon');
0089 ylabel('Backend Units');
0090 
0091

Generated on Sun 14-Jun-2015 17:12:45 by m2html © 2005