Hot answers tagged

10

x is being clipped and that is why y looks like a square wave. When writing x to disk using wavwrite, the samples of x are stored in 16 bits Q15 fixed-point format. That means your data must be in range -1 to +1 (in principle +1 minus one lsb). Therefore, x must be normalized to be in this range before calling wavwrite in order to avoid clipping.


9

This comes from music terminology. The name "octave" comes from the fact that in the heptatonic musical scales (which are the prevalent scales in western music), the note with a 2:1 frequency ratio is the eighth note in the scale. For example, in the C major scale (C D E F G A B C) the eighth note is one octave above / has a 2:1 frequency ratio with the ...


4

You're right: mathematically speaking, nothing would prevent you from defining a grayscale mask. Practically, it is not a good approximation of what is going on. A mask value of 0.5 means that you'd count half the pixel value to your signal. First of all, this will require you to exactly estimate and subtract the camera offset, b/c adding half the offset is ...


4

Frequency is the derivative of phase, so you need to start with the expression for frequency, which in your case is $f=200\exp(-\alpha*t)$ At time $t=0$ this will have the frequency of 200, but we need to solve for $\alpha$ so that the frequency at time $t=2$ is 20. Solving for $\alpha$ gives $\alpha=1.1513$. To get the correct expression for the phase you ...


4

Dynamic Time Warping is pretty well explained on this site. I'll use some of the diagrams from the PPT on that site to explain. The idea is to divide the signals into segments (frames) and then compare frames sequentially through each signal. As illustrated below, motion from a segment in one signal to the next segment depends on the similarity to the ...


3

-6 dB / octave is trivial. a common reference for a pinking filter is http://www.firstpr.com.au/dsp/pink-noise/


3

I am afraid that it is rather impossible without a proper hardware. Sweep sine is ok as a general method, but you would either need: Reference transducer with known (preferably) linear frequency response. Then you can find the difference between those two. Signal actuator with known frequency response, and then you can also find the difference between ...


3

Convolution and polynomial multiplication are equivalent by definition. Offsets are usually introduced through indexing. The treatment of ends is important.


3

Don't know about GNU but in Matlab the frequency argument is specified relative to the Nyquist frequency (fs/2) and not the sample rate itself (fs). This makes the maxium legal argument for a relative cutoff frequency 1 (instead of 0.5). Your frequency argument should be [flo fhi]/fs*2.


3

My guess is that imshow, for some reason, has a lower color depth at which it displays greyscale images than your image viewer. The contours are actually just the quantization steps of the lower number of shades displayable.


3

Your image is an indexed image. Meaning it takes integer values that are supposed to be mapped to colours on screen via a particular colourmap. You can see this if you read your image in as: [I, M] = imread('dots_3gray.png'); where I becomes your 'indexed' image (which seems to contain indices from 0 to 158), and M is the colormap used to interpret it. ...


2

Here a short example of how to deal with FFT in octave/matlab: function freq(npts, len, basefreq) x = [0 : npts - 1] / npts * len; y = sin(basefreq * x * 2 * pi); F = abs(fft(y)); half = npts / 2; F = F(1 : half); plot([0 : half - 1] / len, F); printf("Base frequency = %g\n", (find(F == max(F)) - 1) / len); endfunction try this ...


2

A helpful construction is that of a ,,convolution unit''. If you find a signal that, convolved by itself, stays identical, then you know a lot about how your convolution algorithm works. Note that while all discrete units (all ones surrounded by zeros) are convolution units, certain implementations might introduce padding or offsets so that the resulting ...


2

Final step is pretty straightforward. All you need to do is to apply the Hilbert Transform to each IMF and extract the instantaneous frequency from analytical signal. Instantaneous frequency is given by: $$\omega(t)=\dfrac{d\phi(t)}{dt} $$ where $\phi(t)=\mathrm{arg}[x_a(t)]$ (unwrapped phase of the analytical signal). Keep in mind that MATLAB (Octave) ...


2

reference : Digital Image processing - Rafael Gonzalez Steps : The whole of filtering process can be summarized in the following points : 1> Given an input image f(x,y) of size M X N, obtain the padding parameters P and Q as P =2M and Q = 2N The problem with using DFT is that both the input and output images are periodic. This causes interference between ...


2

The firsts steps by Tzanetakis can be described as an Scheirer algorithm(Tempo and beat analysis of acoustic musical signals by Eric Sheirer), you can use DTW, filterbanks or FFT to split your signal in N subbands! I'll try to help you with what I did in the past, my steps are described below. I can show a simple example of 6(six) (200, 400, 800, 1600, ...


2

Yes, this code is correct for implementing a moving average filter. Nevertheless I do recommend to use the in-built smooth function in MATLAB. y = smooth(x, 100, 'moving')


2

here's what to do for -3 dB/octave (what i remember from 1985): first take your 1/sqrt(f) magnitude function and inverse-warp that frequency response to what it will look like in the analog s-domain. instead of only a -3 dB/oct ramp (which is what you after BLT frequency warping) you have a -3 dB/oct ramp that starts to level out a little in the s-domain. ...


2

I think the solution is to use $\log_{10}(y)$ instead of $\log(y)$. log(y) in octave is the natural $\log$, but you want a log base $10$, which is log10(y). Confirming this: $20\log_{10}(0.5) = -6 \textrm{ dB/octave}$ $20\ln(0.5) = \frac{-13.86}{20} \textrm{ nepers/octave}$ I am using $\textrm{ln}$ for natural log to avoid any confusion.


2

Problem solved. Looks like calculation of Os ($\omega_s$) was the culprit for this problem. Proper equation is: Os=Om*sqrt((gm^2-g1^2)*(1-gm^2))/(1-gm^2); instead of: Os=Om*(sqrt((gm^2-g1^2)*(1-gm^2))/(1-gm^2));


1

I hope I understand what your'e asking correctly To get the minimum slope of the image I would run an calculate the slope at each point (should be fast enough) and than take the minimal one. For example : x = 1:.05:3000; y = 100+x + 300*sin(2*pi*x/1000); origin = [0 0] ; % or origin = [ x(1) y(1) ]; slope = (y - origin(2)) ./ (x - origin(1)); [ minslope ,...


1

You're trying to solve what's called Perona Malik Non Linear Diffusion Problem (Sometimes people call it, by mistake, Anisotropic Diffusion). Anyhow, the simplest code for that is Anisotropic Diffusion (Perona & Malik) on The MATLAB File Exchange. There is a more advanced (Anisotropic for real) algorithm in Fast Anisotropic Curvature Preserving ...


1

Presuming you are using Matlab or GNU Octave, then yes, that should be OK. Compare with this tutorial on doing a moving average with convolution. You've done the division on your kernel, but it makes no mathematical difference whether you do it there or after the convolution. Practically, it takes less time if you do it your way (scaling the kernel.) You ...


1

There exist solutions that are coarsely based on the idea that you propose: Threshold the spectrogram amplitudes to reduce/remove the noise part of the signal. Usually, this will bring about artifacts as e.g. the so-called musical noise and the application determines whether this is acceptable or not. In general, the more the noise is reduced the more ...


1

If you already have the pairs of corresponding two points from each coordinate, you can use the function fitgeotrans to calculate the transformation matrix. Once you have got the transformation matrix, the transformation can be done with imwarp. Note that you are going to use Homography transformation rather than affine transformation in this case (...


1

The general formula for the exponential rise in frequency is given by $f=A+B(1-\exp(-\alpha t))$ We need to solve for the values of $A$, $B$ and $\alpha$. Let's assume you want an initial frequency of $20$ at time $t=0$, and an asymptotic frequency of $200$ Hz at time $t=\infty$. Substituting $t=0$ and $f=20$ into the above equation we find $A=20$. If we ...


1

Make sure that you are trying to compare same quantities, i.e. not $SEL$ with $L_{eq,C}$. If third-octave levels were not measured with any kind of weighting and you are trying to calculate $L_{eq,A}$ for example, then you must apply corrections. For each band calculate the anti-logarithm using the formula: $p_i=10^{L_i/10}$ (for example for $54.3 \mathrm{dB}...


1

1) A Hilbert transform has a very very long impulse response (above some given noise floor), so you need a ton more data to manufacture an analytic signal, otherwise you won't have enough to span the width of the Hilbert impulse response filter without serious edge truncation effects. 2) Instantaneous frequency estimates from this type of artificially ...


1

Your result is not wrong or strange at all. Note that the function 'hilbert' can only approximate a Hilbert transform. Furthermore, the function 'instfreq.m' can only estimate the instantaneous frequency. After all, the relative error between your and the original estimates is really not big at all (obviously apart from the first and last value).


1

Why do not use hough transform for finding lines and then finding table region? you can use hough transform to find horizontal and vertical lines. and then extract region of lines.


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