extracting frequency from 3D Matrix

Hi everyone,
i need to extract the frequency from a "sine wave" from this matrix. As you can see all the freqencies are between 17.1 and 17.2 MHz. But what i need is to extract the frequency of that "sine wave" which is 1 Hz.
To make it a bit easer i made a simplified image using this code:
img = zeros(200, 600); %demo image
numperiods = 1;
amplitude = 50; %pixels
offset = 100;
x = 1:dt:size(img, 2); %pixel subsampling for better resolution
y = sin(x*2*pi/size(img, 2)*numperiods)*amplitude + offset;
img(sub2ind(size(img), round(y), round(x))) = 1;
It is important for me that in the end, i can see the extracted frequency in spectrogram. Do you guys have an idea how to do this?
Thanks
cheers

3 Kommentare

Rik
Rik am 2 Okt. 2020
I think the first step would be to extract the x,y data from the image. find with a threshold will probably do.
I don't have any good idea at this moment for how you could separate the several curves, but that should probably be next step, because after that the fitting of a sine will be trivial.
Ashkan Taremi Zadeh
Ashkan Taremi Zadeh am 6 Okt. 2020
Hi Rik,
Thank you for your suggestion. But i tried it but it doesnt really work. I have to think of another solution.
Rik
Rik am 6 Okt. 2020
Ok, good luck. If you want help you will have to show what you tried.

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Gefragt:

am 2 Okt. 2020

Kommentiert:

Rik
am 6 Okt. 2020

Community Treasure Hunt

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

Start Hunting!

Translated by