⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 magfft.m

📁 实现了传感器定位时
💻 M
字号:
function [mags, fflip]=magfft(obj,zeroPadTo)
% MAGFFT Calculate the magnitude square of the FFT of the
% sensor array sample data, zeropadding by zeroPadTo elements
% Example:
%  result=magfft(s,128);

mag=zeros(obj.NumSamples,zeroPadTo); % Preallocate store of magnitudes
f=asin((-0.5:1/(zeroPadTo-1):0.5)*obj.Wavelength/obj.Spacing)/pi; % Frequencies
fflip=fliplr(f); % Flip frequencies

% Take the sum over each sensor array sample
for k=1:obj.NumSamples
    avbig=zeros(1,zeroPadTo);            % Zero pad
    avbig(1:obj.NumSensors)=obj.Data(1,:);
    response=fft(avbig)/zeroPadTo;       % FFT of normalized signal
    mag(k,:)=abs(fftshift(response)).^2; % Mag squared of FFT
end
mags=sum(mag);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -