Info

This question is closed. Reopen it to edit or answer.

two dim fft matlab

1 view (last 30 days)
Mohammad Sojib
Mohammad Sojib on 20 Jan 2020
Closed: MATLAB Answer Bot on 20 Aug 2021
I have a vector X of size 2x1000. In the first row (X1) each bit is either zero or one which are amplitude. The second row (x2) represents position starting from zero to all the way upto 999. How can I have FFT(X1,X2) in MATLAB?

Answers (1)

Image Analyst
Image Analyst on 20 Jan 2020
That doesn't make sense. You don't want to take the Fourier transform of the location/position of the signal. Just do the amplitude in the first row:
ft = fft(X(1, :));
  3 Comments
Image Analyst
Image Analyst on 21 Jan 2020
Then you don't need FFT. You can just do it in the spatial domain with bwareaopen():
v = [0 0 0 0 0 1 1 1 1 1 0 0 0 1 1 0 0 0 0 1 1 1 0 1]
out = bwareaopen(v, 3)
out =
1×24 logical array
0 0 0 0 0 1 1 1 1 1 0 0 0 0 0 0 0 0 0 1 1 1 0 0
Mohammad Sojib
Mohammad Sojib on 21 Jan 2020
Thanks for the answer.
Even though I understand the operation but it is not suited for my case. for me I could have 1x1000 or even large vector size and each bit is randomly either "0" or "1". So, if I do bwareaopen(v, 50) (I need width 40 to 50 at least) it turns everything into either "0" or "1". Let me give you another example. I have 1x1000 vector. from 50 to 200 and 500 to 505 I have all 1. Everything else is zero. now obviously, both pulses have some frequencies in common. that is why I want to take FFT to resolve the pulses in their frequency components. Then I need to remove (by LPF) these common frequncies while keeping others. then I need to take IFFT and round() to have 1x1000 vector with only values 1 from 50 to 200 or less but atleast with width>=50.
Please let me know if you have any questions.

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!