Signal reconstruction

Thread Starter

lamerooze

Joined Mar 13, 2008
4
I am currently working on a MATLAB program for my research and have run into a wall, despite me looking up quite a number of resources.

Does anybody here know how to reconstruct a signal from an analytic signal?

Given that an analytic signal is made up of the real signal and the hilbert transform of the real signal, where

a(t) = sr(t) + i[sh(t)]

sr(t) = real signal
sh(t) = hilbert transform of the real signal

If you had an analytic signal, how would you decompose this and obtain sr(t) on MATLAB?

The problem with my current approach is that I only obtain sr(t) in the positive time-domain, because all negative frequencies have been stripped due to the effect of the Hilbert transform. I wish to obtain sr(t) which is in both the positive and negative time-domain. How do I circumvent/solve this issue?

EDIT: Any reference to external resources would be a great help thank you!
 

Thread Starter

lamerooze

Joined Mar 13, 2008
4
Can I ask what your current approach is?

Dave
Sure, below is the essence of the code of my rough program - here, I am trying to create a new sound file such that I can vary envelope contributions from two different source files while maintaining the fine structure of one source file.

An example: I have a piano and a flute source file. I create a new sound sample that contains 50% envelope contribution from piano, and 50% from flute, while preserving the fine structure of the piano.

h1a = hilbert(orig1); %orig1 is source file 1
h2a = hilbert(orig2); %orig2 is source file 2

% mag_e1 = magnitude of analytic signal 1

mag_e1a = abs(h1a);
mag_e2a = abs(h2a);

% The fine structure is denoted by arctan(s(t)/sh(t)).

% fs_e1a = fine structure of signal 1

fs_e1a = atan((imag(hilbert(orig1))) ./ orig1));

% changing envelope and fine structure contributions (env1 = %envelope contribution from piano, env2 = %envelope contribution from flute), and obtaining the new signal
e1_fs2 = (((env1/100) .* mag_e1a + (((env2)/100) .* mag_e2a)) .* cos(fs_e1a));

% normalize and save
env1_fts2 = e1_fs2./max(abs(e1_fs2:))));
env2_fts1 = e2_fs1./max(abs(e2_fs1:))));


Now if I were to try to recover my original piano sound by making env1 = 100 and env2 = 0, I cannot do this, because my new sound only contains positive frequency components, while the negative frequency components have been removed. I am wondering how to solve this.

Edited: Have attached an image for visualization purposes. As you can see, the top waveform is of the original file. When I run this program and try to recover my original file, I obtain a sound that has the bottom waveform which is obviously incorrect. However, the bottom waveform is nearly identical to the top half of the top waveform, which means the positive frequency components have been preserved.
 

Attachments

SgtWookie

Joined Jul 17, 2007
22,230
I beg to differ with your assertion that the bottom waveform is nearly identical top the top half of the upper waveform.

It appears to me that the lower waveform is the average of the positive side, and the absolute value of the negative side of the original waveform.

I've never used Matlab, so perhaps someone else will help you with that part.
 

Dave

Joined Nov 17, 2003
6,969
What you describe is a by-product of the Matlab HILBERT function. From the HILBERT function documentation:

The analytic signal for a sequence x has a one-sided Fourier transform, that is, negative frequencies are 0. To approximate the analytic signal, hilbert calculates the FFT of the input sequence, replaces those FFT coefficients that correspond to negative frequencies with zeros, and calculates the inverse FFT of the result.

In detail, hilbert uses a four-step algorithm:

1. It calculates the FFT of the input sequence, storing the result in a vector x.

2. It creates a vector h whose elements h(i) have the values:

1 for i = 1, (n/2)+1

2 for i = 2, 3, ... , (n/2)

0 for i = (n/2)+2, ... , n


3. It calculates the element-wise product of x and h.

4. It calculates the inverse FFT of the sequence obtained in step 3 and returns the first n elements of the result.
A browse of the HILBERT function indicates that it performs the FFT, then conditions the range for positive components only, then applies the IFFT.

I would recommend you look at using the standard FFT and IFFT function in place of the HILBERT function without conditioning the range, before your post analysis. Have a look at the HILBERT function; type "edit hilbert" at the Matlab prompt and use that as your basis.

Dave
 

Dave

Joined Nov 17, 2003
6,969
I beg to differ with your assertion that the bottom waveform is nearly identical top the top half of the upper waveform.

It appears to me that the lower waveform is the average of the positive side, and the absolute value of the negative side of the original waveform.

I've never used Matlab, so perhaps someone else will help you with that part.
What SgtWookie suggests may be worth considering, I too have some reservations about what the lower plot represents. But we will leave that to your intuition.

Dave
 
Top