# fft beamforming - RF Cafe Forums

 The original RF Cafe Forums were shut down in late 2012 due to maintenance issues - primarily having to spend time purging garbage posts from the board. At some point I might start the RF Cafe Forums again if the phpBB software gets better at filtering spam. Below are the old forum threads, including responses to the original posts. -- Amateur Radio -- Anecdotes, Gripes & Humor-- Antennas-- CAE, CAD, & Software -- Circuits & Components-- Employment & Interviews -- Miscellany-- Swap Shop-- Systems-- Test & Measurement -- Webmaster

tsuzu
 Post subject: fft beamforming Posted: Tue Apr 12, 2005 3:09 am
i'm a beginner in this area.
i just learned about the basic algorithm of fft beamforming from internet.and want to implement the algorithm by using matlab,but i don't know how to start(ps,i'm also a new user of matlab).

can anyone give me some sample souce code, even segments are okay.
I'm really stuck in mud.

Manar
 Post subject: Beamformer Posted: Mon May 09, 2005 5:51 am
 Dear Here I give you a sample code for creating the filter coefficients of a Delay and Sum beamformer. if you have any question you can contact me on my email palange@hotmail.fr Have a nice day.[code] c = 340; % m/snfft = 128; % nfft lengthi_omega = -i*2*pi/c; % f will be variablen_mic = 7; mics = [ (-10*3:10:10*3)' zeros(7,1) ]/100;source = [-0.2 0.63]; % to be measuredfs = 22050; % Sampling Frequencyf = (0:nfft-1)*fs/nfft; % Frequency binsW = zeros(n_mic,nfft);d = zeros(n_mic,1);w = zeros(n_mic,1);r = zeros(n_mic,1); u = zeros(n_mic,1);bp = zeros(nfft,181); bps = zeros(1,181);% Filter Coeffor k = 1:n_micr(k) = norm( source - mics(k,:)); endindex = 1;for p=fd = exp(i_omega*p*r)./r; w=d.*r;w=w/abs(w'*d);W(:,index) = w; theta_v=[-90:1:90];source_n=norm(source); for theta = theta_vs=[source_n*sin(theta*pi/180) source_n*cos(theta*pi/180)];for k=1:n_mic u(k) = norm(s-mics(k,:));endd=exp(i_omega*p*u)./u; bps(theta+91)=20*log10(abs(w'*d));endbp(index,:)=bps; index = index + 1;end% here you can plot the BP as a function of DoA for any frequency. % Implementing the Beamformingstart = 1;skiprate = nfft/2;window = triang(nfft)'; num_samples = size(data,2); % data size num_blocks = ceil((num_samples-nfft)/skiprate); frame = 1:nfft;data_frame = zeros(n_mic,nfft); % frame of data ( from each mic)data_fft = zeros(nfft,n_mic); % FFT of the frames = zeros(1,nfft); % frame data (time)S = zeros(1,(n_blocks+1)*nfft/2);for m = 1 : n_blocksdata_frame = data(:,frame); data_fft = fft(data_frame'); s = sum(conj(W).*data_fft'); S(frame) = S(frame) + real(ifft(s.*window)); frame = frame + skiprate;end[\code]

Posted  11/12/2012