- Read the video file and convert the frames into a grayscale.
- Apply Hilbert transform using the ‘hilbert’ function in MATLAB.
- Calculate the phase angle in MATLAB using the ‘angle’ function
- Find out the difference between the two phases.
Computing change in phase of a signal using hilbert transform
    23 ビュー (過去 30 日間)
  
       古いコメントを表示
    
How do I compute the change in phase of a signal using hilbert transform? My input signal is a video, so i want to compute the phase change from frame to frame.
0 件のコメント
回答 (1 件)
  Balaji
      
 2023 年 9 月 22 日
        Hi Anisia 
I Understand that you want to find the phase shift in the of the Hilbert transform of an input video. 
For that I suggest you do the following steps: 
Here is a reference code: 
% Read the video 
video = VideoReader('video.mp4'); 
%Define two frames to be compared 
index1 = 15; 
index2 = 20; 
%Read the corresponding frames 
frame1 = read(video, index1); 
frame2 = read(video, index2); 
signal1 = rgb2gray(frame1); 
signal2 = rgb2gray(frame2); 
% Apply the Hilbert transform 
analyticSignal1 = hilbert(signal1); 
analyticSignal2 = hilbert(signal2); 
% Extract the phase angle 
phase1 = angle(analyticSignal1); 
phase2 = angle(analyticSignal2); 
%Calculate the phase difference 
phaseDifference = phase1 - phase2; 
I suggest you refer the following documentation for more information: 
Hope this helps! 
Thanks 
Balaji 
0 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

