# Calculate signal to noise ratio from the Hillbert envelope of a stacked signal

I am working with seismic waveforms and more specifically with a stack of years of daily seismograms, that I would call the reference waveform. I am trying to calculate the SNR for each daily waveforms by using the envelope of the reference, but I have doubts on how I should calculate the noise. Concretely, I am trying to reproduce what was done in this paper (page 8).

I believe It should be simple, but I have poor basics in signal processing and struggle with notations.

• Welcome to DSP.SE! Interesting question. I've included a screen capture from the paper. Let's see if we can get you an answer. – Peter K. Sep 4 '15 at 13:32

Based on this section of the paper:

Here is my attempt at doing a calculation like that.

The plot above shows three plots:

• The average of the dailies (in green) and all the daily data (in black).
• The function $\sigma$ calculated from the dailies.
• The SNR calculated from $\sigma$ and the dailies.

Scilab code for what I did is below.

// 25624
Tdata = 33;
stack_average = wfir("hp",Tdata,[.3 0],"hm",[0 0]);

Ndays = 30;

ccs = zeros(Ndays,Tdata);

for k=1:Ndays,
ccs(k,:) =  stack_average + 0.05*rand(1,Tdata,'norm').*window('hm', Tdata);
end;

clf
subplot(311)
plot(ccs','k')
plot(stack_average,'g')
xtitle('$\mbox{All } cc \mbox{ in black and } <cc> \mbox{ in green}$')

sigma_N_t = sqrt((mean(ccs.^2,'r') - mean(ccs,'r').^2)/(Ndays-1));
s_N_t = abs(hilbert(mean(ccs,'r')));
SNR_N_t = s_N_t ./ sigma_N_t;

subplot(312)
plot(sigma_N_t)
xtitle('$\mbox{\rm Level of noise,}\ \sigma$')

subplot(313)
plot(s_N_t, 'r')
xtitle('$\mbox{\rm Signal to noise ratio,}\ SNR$')

• Thanks for your answer, it made things clearer. I was mostly worried with the example because there is no way for me to have such a "smooth" result even with a similar cosine smoothing. – SeisMike Sep 6 '15 at 16:42