[R] R: R: Morlet wavelet not supportd by wavCWTPeaks
mauede at alice.it
mauede at alice.it
Sat Dec 6 20:01:43 CET 2008
I have compressed and attached the 1st cycle of signal 3570.
I did not realize the difficulties arising from copying the signal data from the email text.
I did not understand how you were reading such data into a vector. When I plotted the signal, the way
you read it, it looked periodic, whereas the original is not.
Since wmTSA functions worked fine with your signal version, I inferred that wavCWTPeaks expects a periodic input series.
Consequently I generated a signal through duplicating the original 1-cycle data. So my new signal contains two consecutive cycles
which are equal. This way wavCWTPeaks worked and fund the extrema.
I realized I modified the original 1-cycle signal myself. I did not alter the breathing rate or the cycle pattern in any way. Since the goal is to find the extrema, all what I expected is to see a set of replicated extrema at corresponding time points.
But wavCWTPeaks is probably smart enough as to dispose of duplicated extrema.
I sent you a detailed description of this experiment from another account.
I am still concerned about wavCWTPeaks working on a duplicated version of the original 1-cycle signal that it cannot process.
If periodicity is not the key reason then I don't get it.
Can you suggest a better procedure to get the 1-cycle extrema without using the trick I resorted to ?
Best regards,
Maura
-----Messaggio originale-----
Da: stephen sefick [mailto:ssefick at gmail.com]
Inviato: sab 06/12/2008 18.14
A: mauede at alice.it
Cc: R-help
Oggetto: Re: R: Morlet wavelet not supportd by wavCWTPeaks
Now, wavelet analysis works with non-stationary signals the package is
an implememtation of wavelet analysis. The signal that I used was the
one that you provided. I did copy it out of an email and put it
together into a vector so that I could read it in. If the original
data is wrong that is probably my fault, but you need to provide data
that can be just read into R without the potential of screwing up the
content- see dput(). That way you get the best help possible with
the least amount of work on the lists part. Please send me the real
signal and maybe we can work it out. If wmtsa is not going to work
then it is not going to work. Find something else that work or write
your own package.
Stephen
On Sat, Dec 6, 2008 at 4:57 AM, <mauede at alice.it> wrote:
> Sure. Now it works ... but it is a different signal !
> I could not understand how the signal I sent was modified. So I plotted
> yours version of the signal and mine (see attachments).
> My signal represent a single breathing cycle extracted from a breathing
> signal. It shows that the individual completed one respiratory cycle
> in about 8 seconds, so he/she is breathing very deeply and slowly.
> Whereas you transformed it into the breathing pattern of someone who can
> complete almost 5 respiratory cycles within 8 seconds, therefore breathing
> at a much higher rate ... maybe short of breath.
> The whole original signal can be seen on my web site:
> http://trusoftdev.za.net/maura/Breathing-Signals-Dir/Signals-Dir/3570-Dir/Plots-Dir/3570-Original-PureSignal.pdf
>
> Bottomline: I need a package that helps me shed light onto the original
> signals I was given. I cannot alter the signals in order to make the package
> work.
> I need to analyze true signals not fake ones.
> If wmTSA cannot work on non-periodic signals then it should be stated in the
> on-line documentation.
> Any suggestion ?
>
> Thank you very much.
> Maura
>
> -----Messaggio originale-----
> Da: stephen sefick [mailto:ssefick at gmail.com]
> Inviato: sab 06/12/2008 8.25
> A: mauede at alice.it
> Cc: R-help
> Oggetto: Re: Morlet wavelet not supportd by wavCWTPeaks
>
> aa <- (structure(list(X.0.85 = c(-1.02, -1.17, -1.29, -1.39, -1.46,
> -1.5, -1.52, -1.5, -1.46, -1.39, -1.3, -1.19, -1.07, -0.93, -0.79,
> -0.65, -0.5, -0.36, -0.22, -0.08, 0.05, 0.18, 0.3, 0.41, 0.52,
> 0.62, 0.72, 0.81, 0.89, 0.98, 1.05, 1.13, 1.19, 1.25, 1.29, 1.31,
> 1.31, 1.29, 1.24, 1.16, 1.06, 0.93, 0.77, 0.58, 0.38, 0.16, -0.07,
> -0.31, -0.89, -1.05, -1.19, -1.31, -1.41, -1.47, -1.51, -1.51,
> -1.49, -1.44, -1.37, -1.28, -1.17, -1.04, -0.91, -0.76, -0.62,
> -0.47, -0.33, -0.19, -0.06, 0.08, 0.2, 0.32, 0.43, 0.54, 0.64,
> 0.73, 0.82, 0.91, 0.99, 1.07, 1.14, 1.2, 1.25, 1.29, 1.31, 1.31,
> 1.28, 1.23, 1.15, 1.04, 0.9, 0.73, 0.55, 0.34, 0.11, -0.12, -0.92,
> -1.08, -1.22, -1.33, -1.42, -1.48, -1.51, -1.51, -1.48, -1.43,
> -1.35, -1.26, -1.14, -1.01, -0.88, -0.74, -0.59, -0.45, -0.3,
> -0.16, -0.03, 0.1, 0.22, 0.34, 0.45, 0.56, 0.66, 0.75, 0.84,
> 0.93, 1.01, 1.08, 1.15, 1.21, 1.26, 1.3, 1.31, 1.3, 1.27, 1.21,
> 1.13, 1.01, 0.87, 0.7, 0.5, 0.29, 0.07, -0.17, -0.95, -1.11,
> -1.24, -1.35, -1.44, -1.49, -1.51, -1.51, -1.48, -1.42, -1.33,
> -1.23, -1.12, -0.99, -0.85, -0.71, -0.56, -0.42, -0.27, -0.14,
> 0, 0.13, 0.25, 0.36, 0.47, 0.58, 0.68, 0.77, 0.86, 0.94, 1.02,
> 1.1, 1.17, 1.23, 1.27, 1.3, 1.31, 1.3, 1.26, 1.2, 1.11, 0.98,
> 0.83, 0.66, 0.46, 0.25, 0.02, -0.22, -0.99, -1.14, -1.27, -1.37,
> -1.45, -1.5, -1.52, -1.5, -1.47, -1.4, -1.32, -1.21, -1.09, -0.96,
> -0.82, -0.68, -0.53, -0.39, -0.25, -0.11, 0.02, 0.15, 0.27, 0.39,
> 0.5, 0.6, 0.7, 0.79, 0.87, 0.96, 1.04, 1.11, 1.18, 1.24, 1.28,
> 1.31, 1.31, 1.29, 1.25, 1.18, 1.08, 0.96, 0.8, 0.62, 0.42, 0.2,
> -0.03, -0.27)), .Names = "X.0.85", class = "data.frame", row.names = c(NA,
> -240L)))
> library(wmtsa)
> library(fields)
> aats <- ts (aa, deltat =1/30, start = 0.0)
> aa.cwt <- wavCWT(aats)
> aa.tree <- wavCWTTree (aa.cwt)
> aa.peak <- wavCWTPeaks(aa.tree)
>
> sorry I didn't realize that only the mexican hat wavelet could be used
> for the peak function. This should work fine. and Use the tim.colors
> argument in the plot() function. I hope this helps.... This reason I
> suggested the morlet wavelet is that it is compactly suppoted
>
> On Sat, Dec 6, 2008 at 1:39 AM, <mauede at alice.it> wrote:
>> aa.cwt <- wavCWT(aats,wavelet="morlet")
>>> aa.cwt
>> Continuous Wavelet Transform of aats
>> ------------------------------------
>> Wavelet : Morlet
>> Wavelet frequency shift : 5 (rad/sec)
>> Length of series : 241
>> Sampling interval : 0.03333333
>> Number of scales : 65
>> Range of scales : 0.0333333333333333 to 8.03333333333333
>>> aa.cwt.coef <- as.matrix (aa.cwt)
>>> plot (aa.cwt, series=TRUE)
>>> plot (aa.cwt, type="persp")
>>
>>> aa.tree <- wavCWTTree (aa.cwt)
>>> aa.peak <- wavCWTPeaks (aa.tree)
>> Error in wavCWTPeaks(aa.tree) :
>> Only CWT developed using the Mexican hat (gaussian2) filter are
>> supported
>>>
>>
>> Alice Messenger ;-) chatti anche con gli amici di Windows Live Messenger e
>> tutti i telefonini TIM!
>> Vai su http://maileservizi.alice.it/alice_messenger/index.html?pmk=footer
>
>
>
> --
> Stephen Sefick
>
> Let's not spend our time and resources thinking about things that are
> so little or so large that all they really do for us is puff us up and
> make us feel like gods. We are mammals, and have not exhausted the
> annoying little problems of being mammals.
>
> -K. Mullis
>
>
>
>
> Alice Messenger ;-) chatti anche con gli amici di Windows Live Messenger e
> tutti i telefonini TIM!
> Vai su http://maileservizi.alice.it/alice_messenger/index.html?pmk=footer
--
Stephen Sefick
Let's not spend our time and resources thinking about things that are
so little or so large that all they really do for us is puff us up and
make us feel like gods. We are mammals, and have not exhausted the
annoying little problems of being mammals.
-K. Mullis
Alice Messenger ;-) chatti anche con gli amici di Windows Live Messenger e tutti i telefonini TIM!
Vai su http://maileservizi.alice.it/alice_messenger/index.html?pmk=footer
More information about the R-help
mailing list