Hi JNoq,
Your N value is right.
N are the samples per pulsewidth (=Tp). If you have a pulsewidth of 20 ms and your Sample frequency (=FS, which is the Sample Frequency of your PC Soundcard, in here 44.1 kHz) your Vectorsize N should be N=Tp*FS = 0.02 s * 44100 1/s = 882
The "Trig" values are the combined (commulated) Samples that were above Threshold and depends on your record time of wav file. For example if you have a pulse width of 20 ms, which reveals when sampling at 44.1 kHz a vectorlength N of 882 Samples.
Now you recorded Wav file length is 81 sec then,
882 Samples per 20 ms = 44100 Samples per second * 81 sec = 3572100 which is your Trig vector size.
I am adding my comments on all of the code, maybe it helps understanding more,
%MIT IAP Radar Course 2011
%Resource: Build a Small Radar System Capable of Sensing Range, Doppler,
%and Synthetic Aperture Radar Imaging
%
%Gregory L. Charvat
%Process Range vs. Time Intensity (RTI) plot
%NOTE: set upramp sweep from 23.2V to stay within ISM band
%change fstart and fstop bellow when in ISM band
clear all;
close all;
%read the raw data .wave file here
[Y,FS,NBITS] = wavread('running_outside_20ms.wav');
%[Y,FS,NBITS] = wavread('traktorinfrontCan.wav');
%constants
c = 3E8; %(m/s) speed of light
%radar parameters
Tp = 20E3; %(s) pulse time
N = Tp*FS; %# of samples per pulse
%fstart = 2260E6; %(Hz) LFM start frequency for example
%fstop = 2590E6; %(Hz) LFM stop frequency for example
fstart = 2257E6; %(Hz) LFM start frequency for ISM band
fstop = 2544E6; %(Hz) LFM stop frequency for ISM band
BW = fstopfstart; %(Hz) transmti bandwidth
f = linspace(fstart, fstop, N/2); %instantaneous transmit frequency
%RADAR equations range resolution
rr = c/(2*BW); % range resolution in [m]
max_range = rr*N/2; % max range in [m]
%the input appears to be inverted
trig = 1*Y(:,1); % takes the samples (trigger) from Left channel wav
s = 1*Y(:,2); % takes the samples from the Right channel wav file
%clear Y; % clears the 2 channel origin wav file matrix
%parse the data here by triggering off rising edge of sync pulse
% in other words: Here we take the samples where the sync pulse started "hi"
% remember the Chirp is a triangle, we are not interested in the "downhill"
%
count = 0;
thresh = 0;
start = (trig > thresh); % populates a vector with logical 0's and 1's where "trig" >0
for ii = 100:(size(start,1)N) %looking at the logic vector starting at 100
if start(ii) == 1 && mean(start(ii11:ii1)) == 0 % if last sample is 1 and the last 11 consequented samples = 0 then we have a rising edge
%start2(ii) = 1;
count = count + 1; % index counter for final vector
sif(count,:) = s(ii:ii+N1); % populates our result vector with N Samples (pulsewidth) of the Right channel Wavsamples
time(count) = ii*1/FS; % clculates the time vector accordingly
end
end
%check to see if triggering works
figure(1);
plot(trig,'.b');
hold on;
% plot(start2,'.r');
% hold off;
%grid on;
%subtract the average
ave = mean(sif,1);
for ii = 1:size(sif,1);
sif(ii,:) = sif(ii,:)  ave;
end
zpad = 8*N/2;
%RTI plot
figure(10);
v = dbv(ifft(sif,zpad,2));
S = v(:,1:size(v,2)/2);
m = max(max(v));
imagesc(linspace(0,max_range,zpad),time,Sm,[80, 0]);
colorbar;
ylabel('time (s)');
xlabel('range (m)');
title('RTI without clutter rejection');
%2 pulse cancelor RTI plot
figure(20);
sif2 = sif(2:size(sif,1),:)sif(1:size(sif,1)1,:);
v = ifft(sif2,zpad,2);
S=v;
R = linspace(0,max_range,zpad);
for ii = 1:size(S,1)
%S(ii,:) = S(ii,:).*R.^(3/2); %Optional: magnitude scale to range
end
S = dbv(S(:,1:size(v,2)/2));
m = max(max(S));
imagesc(R,time,Sm,[80, 0]);
colorbar;
ylabel('time (s)');
xlabel('range (m)');
title('RTI with 2pulse cancelor clutter rejection');
% %2 pulse mag only cancelor
% figure(30);
%clear v;
%for ii = 1:size(sif,1)1
% v1 = abs(ifft(sif(ii,:),zpad));
% v2 = abs(ifft(sif(ii+1,:),zpad));
% v(ii,:) = v2v1;
% end
%S=v;
%R = linspace(0,max_range,zpad);
%for ii = 1:size(S,1)
% S(ii,:) = S(ii,:).*R.^(3/2); %Optional: magnitude scale to range
%end
%S = dbv(S(:,1:size(v,2)/2));
%m = max(max(S));
%imagesc(R,time,Sm,[20, 0]);
%colorbar;
%ylabel('time (s)');
%xlabel('range (m)');
%title('RTI with 2pulse mag only cancelor clutter rejection');
