# 2-D low pass filter

I have an ultrasound signal that is 1536x128. I first downsample the signal by a factor of 2x2 in x and t, then I upsample the missing data with zeros, then I do an fft, fftshift, then another fft to get the 2-D frequency spectrum. Due to the upsampling, I got many replicas to my original data, and I need to implement a low pass filter to extract the original data only, but the signal is kinda weird as the replicas are too close to the original signal.Can you help me implement a low pass filter capable of extracting the original data? Please see attached images for clearer details. Thanks!

%-- subsample original data
Sx = 2;     %-- subsampling factor for original x-axis
St = 2;     %-- subsampling factor for original t-axis
NtFFT = 4096;  %-- frequency points
NxFFT = 256;
Nt = 1536;
Nx = 128;

Signal_sampled = Signal(1:St:end,1:Sx:end);

%-- upsample subsampled data
if St > 1
Du = zeros(Nt,size(Signal_sampled,2)); js = 1;
for ju = 1:St:Nt
Du(ju,:) = Signal_sampled(js,:); js = js + 1;
end
Signal_sampled = Du;
end
if Sx > 1
Du = zeros(size(Signal_sampled,1),Nx); js = 1;
for ju = 1:Sx:Nx
Du(:,ju) = Signal_sampled(:,js); js = js + 1;
end
Signal_sampled = Du;
end

Signal_sampled_fft = fft(Signal_sampled,NxFFT,2);

Signal_sampled_fft = fftshift(Signal_sampled_fft,2);

Signal_sampled_fft2 = fft(Signal_sampled_fft,NtFFT,1);

Signal_sampled_fft2 = Signal_sampled_ftt2(1:NtFFT/2,:);


The first image is the original spectrum, and the second is the full spectrum I got after upsampling, and the third is the upper half of the same spectrum in the 2nd image. I am trying to extract the signal that looks like the first image. Thanks!

• The moment you subsampled, you introduced aliases, and that can't be undone. You need to low-pass filter first, then subsample. – Marcus Müller Oct 25 '19 at 8:59
• Thanks marcus, is that the only way to avoid aliasing? You mean to apply a low pass filter in the time-x domain before actually applying the downsampling? – ZABA Oct 25 '19 at 21:27
• yes, and yes, exactly as I wrote. – Marcus Müller Oct 25 '19 at 21:29