필터 지우기
필터 지우기

image plot after is calculating hilbert spectrum

조회 수: 14 (최근 30일)
Ramya Raman
Ramya Raman 2019년 7월 17일
댓글: jiayun zhang 2020년 4월 20일
I have used th matlab function [hs,f,t,imfinsf,imfinse] = hht(imf,fs); to do hilbert haung transform.
The hilbert spectrum (hs) is a sparse matrix. How could this be plotted as an image plot? I tried to convert this to a double matrix using full(hs). But this doesn't give a hilbert spectrum. Its just blank. How to resolve this?
  댓글 수: 1
jiayun zhang
jiayun zhang 2020년 4월 20일
I am also studying HHT transformation recently. I have met the same problem as you. I want to plot the instantaneous energy spectrum, but I don't know how to achieve it. Have you solved the problem

댓글을 달려면 로그인하십시오.

답변 (1개)

Michael Madelaire
Michael Madelaire 2019년 7월 17일
편집: Michael Madelaire 2019년 7월 17일
There shouldn't be any problem. But you have attached no code, so it is hard to know.
Without for information many things could be the problem. Below is a test. There show be no problem in plotting a sparse matrix.
a = diag(1:20); % Create diagonal matrix
b = sparse(a); % Convert into sparse matrix
c = full(b); % Convert sparse matrix back into full matrix
figure();
imagesc(a); title('Original full matrix'); colorbar();
figure();
imagesc(b); title('Sparse matrix'); colorbar();
figure();
imagesc(c); title('Converted full matrix'); colorbar();
I do not know anything about the Hilbert-Huang Transformation. But by taking the initial example from: https://se.mathworks.com/help/signal/ref/hht.html
I converted the sparse matrix into full. No problem
Plotted the sparse matrix. No problem
Plotted the converted matrix (into full). No problem
load('sinusoidalSignalExampleData.mat','X','fs')
t = (0:length(X)-1)/fs;
figure();
plot(t,X)
xlabel('Time(s)')
[imf,residual,info] = emd(X,'Interpolation','pchip');
hs = hht(imf,fs);
q = full(hs);
figure();
imagesc(hs); colorbar()
figure();
imagesc(q); colorbar()
  댓글 수: 2
Ramya Raman
Ramya Raman 2019년 7월 17일
Thank you for your response. What I am try to do is,
%%%%
[hs,f,t,imfinsf,imfinse] = hht(imf,fs);
q = full(hs);
imagesc(imfinsf(:,1),f,q);
However, this is not close to the plot when I directly plot hht(imf,fs); without getting the return values.
Michael Madelaire
Michael Madelaire 2019년 7월 17일
It is unclear to me what it is you want illustrated?
imagesc(imfinsf(:,1),f,q);
Does not make any sense.
The imagesc specification states:
"imagesc(x,y,C) specifies the image location. Use x and y to specify the locations of the corners corresponding to C(1,1) and C(m,n). To specify both corners, set x and y as two-element vectors. To specify the first corner and let imagesc determine the other, set x and y as scalar values. The image is stretched and oriented as applicable."
When you say "I directly plot hht(imf,fs); without getting the return values" what does that mean? There has to be a return value otherwise nothing is plotted. Do you mean hs?

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Hilbert and Walsh-Hadamard Transforms에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by