Sign in

username:

password:



Not a member?

Search matlab



Search tips

Subscribe to matlab



matlab by Keywords

Atanh | Autocorrelation | Bandpass Filter | C++ | Conv | Database | Deconv | Excel | FFT | Filter | Filtering | FIR | Fourier Transfrom | FSK | Gaussian Noise | Haykin | IFFT | Image | Java | LFSR | LMS | LPC | MEX | OFDM | QPSK | Radix | Random | Sampling | Segmentation | Simulink | Visual Basic | Waveform | Wavelet


Discussion Groups

See Also

Embedded SystemsFPGAElectronics

Discussion Groups | Matlab DSP | envelope of a signal

Technical discussion about Matlab and issues related to Digital Signal Processing.

  

Post a new Thread

envelope of a signal - Orla - Nov 13 11:56:00 2001

Hi,
I am doing a project in college at the moment on Music
Synthesis in Matlab.

How, using Matlab, could we obtain the envelope of our
signals.

Thanks

Orla



______________________________
New Code Sharing Section now Live on DSPRelated.com. Learn about the Reward Program for Contributors here.



(You need to be a member of matlab -- send a blank email to matlab-subscribe@yahoogroups.com )

Re: envelope of a signal - Michael Strothjohann - Nov 13 15:42:00 2001

Hi Orla,

First:
Welcome to the exiting world of Music Synthesis.

Second:
Now, the bad news: Matlab is mathematics and
using matlab without some mathematical background
makes no sense. Is the signal processing toolbox
available in your college? I'm sorry, this dosn't
realy help you, mathematical backround is now
needed also. But now the very bad news:
Any toolbox dosn't realy free you from
learning the underlying mathematics.

Third:
Hint Nr.1: Learn about hilbert-transform.
Alternate hint Nr.2: In your system there are two timescales:
a short time scale for the changes of your
tone-signal, and a (i hope) longer time scale
for the changes in the volume. The envelop
is measuring the slowly changing volume,
so in a FIRST try you may use a moving window
on your data and after finding the min/max in this
moving slice you get a rough estimate for the
enverlop of your signal. You are interested in
music and electronics ? Try to build a
lowPass using matlab with a time-constant
between the above mentioned time-scales.
Have much fun.

michael

Orla schrieb:
>
> Hi,
> I am doing a project in college at the moment on Music
> Synthesis in Matlab.
>
> How, using Matlab, could we obtain the envelope of our
> signals.
>
> Thanks
>
> Orla > _____________________________________
> /groups.php3



______________________________
Start your Android Ice Cream Sandwich development on TI's AM35x Sitara ARM Cortex-A8 processor today.



(You need to be a member of matlab -- send a blank email to matlab-subscribe@yahoogroups.com )

RE: envelope of a signal - Michal Kaczmarek - Nov 14 8:36:00 2001

Hi,
Few years ago I wrote script which takes modulated signal x and its
envelope. You must also give as a parameter order of Hilbert filter. There
is its listing below:

function [y]=dem_am(x,P)
%AM demodulation of signal x
% y=dem_am(x,P);
%
% y - signal envelope
% x - modulated signal
% P - filter order

for k=-P:P % Hilbert filter coefficients
if round(k/2)*2==k
d(k+P+1)=0;
else
d(k+P+1)= 2/(k*pi)*(0.54+0.46*cos(pi*k/P));
end
end

xh=conv(d,x); % filter
xh=xh(P+1:length(x)+P);
xh=xh/max(xh)*max(x); % scale

y=sqrt(x.^2 + xh.^2);

%---------------------------------------------------------------------------
----------------------------------------------------------------------------
----------
For example try this:

t=0:0.01:20;
x1=sin(2*pi*1*t);
x2=sin(2*pi*0.1*t);
y=x1.*x2;
z=dem_am(y,10);
figure(1)
plot(y)
figure(2)
plot(z)

%---------------------------------------------------------------------------
----------------------------------------------------------------------------
----------

But you have to know, that to understand this process you should read some
signal processing theory !!!!!!!!!!!!!!!!! Best Regards, Michal


______________________________
New Code Sharing Section now Live on DSPRelated.com. Learn about the Reward Program for Contributors here.



(You need to be a member of matlab -- send a blank email to matlab-subscribe@yahoogroups.com )