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 Comments

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.
Hi Rik,
Thank you for your suggestion. But i tried it but it doesnt really work. I have to think of another solution.
Ok, good luck. If you want help you will have to show what you tried.

Sign in to comment.

Answers (0)

Asked:

on 2 Oct 2020

Commented:

Rik
on 6 Oct 2020

Community Treasure Hunt

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

Start Hunting!