# Tag Info

26

I had a go with HiddenMarkovProcess[], based on the assumption that the data is normally distributed around two different means (it looks like it!). This approach should be fine for cases where the number of "states" is small, e.g. 2 in this case. Otherwise you're looking at Infinite Hidden Markov Models, or see the bottom of this answer. To remove some ...

17

Yes, you are right. WaveletScalogram produces a plot that is very similar in behaviour to that used in music. Here, the octave axis is also logarithmic: -Log[2,b], meaning that the frequency at the next octave is doubled. We can illustrate this by a simple example - Consider a signal with a freq = 440Hz and a signal with double that freq = 880Hz. Now, ...

16

So, you have a function $F(x,y) = f_x(x)g_y(y) + g_x(x)f_y(y)$, and you want to recover $f_x,g_y,g_x,f_y$. If you've tabulated the values of $F(x,y)$ in a matrix $\mathbf F$ with entries $f_{ij} = F(x_i,y_j)$, then this amounts to decomposing the matrix as $$\mathbf F \approx \mathbf f_x\mathbf g_y^T + \mathbf g_x\mathbf f_y^T,$$ where $\mathbf f_x,\mathbf ... 16 ListPlot@{l1, msf = MeanShiftFilter[l1, IntegerPart[Length@l1/10], MedianDeviation@l1, MaxIterations -> 10]} And here are the detected means (assuming there are three): fc = FindClusters[msf]; Mean /@ fc ( *{3.77282, 220.788, 387.444} *) 11 So, in order to answer your question I will first provide a little information about the so-called padding in wavelet transforms. For the continuous wavelet transform there will be problems near the edge of the time series, as the wavelet starts to run off the end. To minimize these problems, the time series can be padded with zeroes. This reduces the ... 11 EDIT: First, a note: As the usage of options, parameters and functions listed below is not documented, be advised that they still need proper tuning and/or may not work at all. CMorletWavelet[]["WaveletQ"] := True CMorletWavelet[]["OrthogonalQ"] := False CMorletWavelet[]["BiorthogonalQ"] := False CMorletWavelet[]["WaveletFunction"] := 1/Sqrt[π] Exp[2 I π ... 11 Since you haven't provided any data I define something like: data = Table[ Sin[2 Pi t] + 0.86 Sin[97 Pi t] Cos[46 Pi t] Sin[39 Pi t] Cos[19 Pi t] Exp[-102 (1/3 - t)^2], {t, 0.091, 0.519, 1/4095}]; ListLinePlot[data, PlotStyle -> Thick] Now let's demonstrate how WaveletScalogram depends on the choice of ContinuousWaveletTransform ... 11 In the old Mathematica wavelet explorer, the one used in the tutorial, coefficients were arranged in decreasing order of energy. You can see that from the following line from the tutorial, In[8]:= Dimensions /@ wtdata Out[8]= {{32,32},{3,32,32},{3,64,64}....} In the new Mathematica 8 wavelets the coefficients are arranged in increasing order of energy as ... 11 Another approach is to use compound median filtering which returns a blocky function. Then threshold the jumps between blocks. No assumptions about the number or size of blocks is made. Function to plot the input series as discrete jumps. BlockPlot[s_] := Partition[ Flatten[{s[[1]], Table[{{s[[i, 1]], s[[i - 1, 2]]}, s[[i]]}, {i, 2, ... 10 I found a way to do this thanks to the more simple question I posted here: Wrapping ArrayPlot or MatrixPlot around a circle but it takes a very long time to compute. So I will post the answer but I hope someone will post a faster solution. cwd = ContinuousWaveletTransform[data, GaborWavelet[6], {4, 12}, WaveletScale -> 100]; ws = WaveletScalogram[cwd, ... 9 After consulting a friend of mine P.M. I can tell you this. First of all as @Szabolcs @ruebenko already mentions - in order to get a comparison with Wavelet explorer (v7) to v8, you can go to the following link in the documentation center which shows how the syntax has changed: http://reference.wolfram.com/mathematica/Compatibility/tutorial/WaveletExplorer.... 8 I am not sure where your problem lies exactly. If you have a set of points, x_i,y_i which obey the PDF F[x,y], you could do maximum likelihood analysis. A parametric model could be gxa[x_, a_] = Exp[-a x]/(Exp[-5 x] + 5); G[x_, y_, a_] = fx[x] gy[y] + gxa[x, a] fy[y]; with the corresponding normalization (so that its a PDF) norma[a_] = Table[{a, ... 7 We can visualize the wavelet scalogram using ListPolarPlot data = Re[Zeta[1/2 + I Range[0, 100, 0.01]]]; cwd = ContinuousWaveletTransform[data, GaborWavelet[6], {4, 12}, WaveletScale -> 100]; ListPolarPlot[Abs@Reverse[Last /@ cwd[All]], ColorFunction -> "Rainbow"] Additionally we can see the scalogram in 3D using ListPlot3D: ListPlot3D[Abs@... 7 An alternative; we will discard the time values. f[list_, pos_] := Module[{x = list}, x[[All, pos]] = Sequence[]; x] data = Import[ "http://www.fileconvoy.com/gf.php?id=geed872d9b8a38dc6999443310. 4661369818fbd5fa1bf3bc&sts=138977900593152145247060b494909aee48bb2a26b595048647"]; fdata = Flatten@f[data, 1]; cwd = ContinuousWaveletTransform[fdata, ... 7 I won't catch the fish for you rather than teach you how to do it. Generate a random data set: data = LowpassFilter[Accumulate@Re@Fourier[Table[RandomReal[{-.5, .5}] Sinh[Exp[RandomReal[{-.5, .5}]^2]], {2^10}]], .4]; and transform it dwd = DiscreteWaveletTransform[data, HaarWavelet[]] swd = StationaryWaveletTransform[data, HaarWavelet[]]... 6 Here is a rather quick attempt. Define a function which converts frequencies to the nearest pitch. NoteName[freq_] := Module[{notelist,freqlist,list}, notelist = {"B"}~Join~ Nest[Join[{"C", "C\[Sharp]/D\[Flat]", "D", "D\[Sharp]/E\[Flat]", "E", "F", "F\[Sharp]/G\[Flat]", "G", "G\[Sharp]/A\[Flat]", "A", "A\[Sharp]/B\[Flat]", "B"}, #] &,... 6 So, the scalogram is a raster, so what? Why does it deter you from just wrapping it around the pole? ws = WaveletScalogram[cwd, All, Re, ColorFunction -> "CherryTones", Axes -> False, PlotRangePadding -> None, AspectRatio -> 1] ImageTransformation[ws, {(ArcTan @@ (0.5 - #) + Pi)/(2 Pi),2 Norm[0.5 - #]} &] 6 The Spectrogram function also allows you to alter the window length, overlap and apply a windowing function to your data segment before FFT. You'll get better results if you utilize those (which requires some knowledge of DSP and your specific problem) instead of using the default parameters and the rectangle window. For instance, the following shows the ... 5 Unless I'm missing something, your question does not make sense. The cascade algorithm is an iterative solution to$\phi(x)=\sum_{k=0}^{N-1} c_k \phi(2 x - k)$, which computes$\phi(x)$approximately at dyadic points$x=k\times2^{-j}$, to whatever resolution you choose for the initial approximation. The definition$\phi_{j,k}(x)=2^{j/2} \phi(2^{j} x - k)$... 5 Try specifying your function as MyWavelet[n_,opts:OptionsPattern[]] (documentation) and define Options to your function Method->"PrimalLowpass",Precision->$MachinePrecision, like this: Options[MyWavelet] ={Method->"PrimalLowpass",Precision->$MachinePrecision} To actually construct all this as a function, you need to put certain steps as a ... 4 While it may be a complicated question about whether the Continuous Wavelet Transform (CWT) in general is a linear operator, it is possible to answer the question "experimentally" without undue hassle regarding Mathematica's implementation of the CWT. Here are two sequences, a and b and their ContinuousWaveletTransforms: a = RandomReal[{-1, 1}, 100]; b = ... 4 I don't know if you are wedded to wavelets but... Have you considered a "compound median filter" (q.v.) ? For a list of data x and filter width 2r+1, MedianFilterRoot[x_, r_] := FixedPoint[MedianFilter[#, r] &, x] CompoundMedianFilter[x_, r_] := Fold[MedianFilterRoot[#1, #2] &, x, Range[r]] Plotting CompoundMedianFilter[x,r-1]-... 4 I'm pretty sure there ought to be something cleaner. While we wait for a better answer, you may use this to return the minimum and maximum number of arguments allowed for each wavelet: nArgs[fun_] := StringCases[ToString@DownValues@fun, Shortest["ArgumentCountQ"~~__~~(n1:NumberString)~~__~~ (n2:NumberString)] :> ToExpression[{... 4 Both the scaling and wavelet functions of the DaubechiesWavelet are compactly supported on the interval$\left [ 0, N-1 \right ]$, where N is the number of "taps", the impulse response length or just the length of the filter. Choose the one that suits you ^^ Bear in mind that the notation in Mathematica is slightly different - The wavelets are classified by ... 4 Keep in mind this is only a partial solution and it is supposed to give you ideas and some insight. First to give you an idea of where I am going consider the following example img = Import["http://i.stack.imgur.com/yV8FW.png"] WaveletImagePlot[DiscreteWaveletTransform[img]] Now on to the more interesting problem at hand fx[x_] := 1/(Exp[-x - 7] + ... 4 The reason behind the blurry inverse transformations lies in the fact that a function (ImageAdjust) is applied to the wavelet coefficients when you call DiscreteWaveletData. And that's not what we want. img = ExampleData[{"TestImage", "Lena"}]; dwd = DiscreteWaveletTransform[img, HaarWavelet[], 1]; newdwd = DiscreteWaveletData[ dwd[All, {"Image",... 4 Update-2: More compact version proposed by J. M. with the matrix normalized: steps = 3; (*order = 2^step*) h = Nest[Join[KroneckerProduct[#, {1, 1}], KroneckerProduct[IdentityMatrix[Length[#]], {1, -1}]] &, {{1}}, steps]; Orthogonalize[h] // MatrixForm Update-1: Creates un-normalized Haar matrix for$\text{order} = 2^n$. steps = 3; ... 3 Once again I repeat that trying to reproduce something like the curve you are trying to get is going to be inaccurate - There are more suitable representations you can use to get the desired frequency spectrum, but you are the one asking the questions :) First, we fetch your data data = Import[ "http://www.fileconvoy.com/gf.php?id=... 3 To answer your first question - yes. The wavelet scalogram or wavelet energy density function is defined as $$S(t_{0}, s) = \left |W(t_{0}, s) \right |^{2}$$ where$W(t_{0}, s)$is the wavelet transform at time$t_0$and scale$s$. If you are interested in the region around time$t_0$then$S(t_{0}, s)\$ would be the instantaneous energy distribution at that ...

Only top voted, non community-wiki answers of a minimum length are eligible