09-30-2022 03:55 PM
I should explain something else I said. (...thought of this later)
I suspect you are a student. That's fine. When I said times ta, tb, tc...tn during the sweep of the derivatives, understand you're actually sweeping over the frequencies that make up your X(f). Hence, when I say "time" I'm actually speaking of an instance of a detected zero during the sweep. At that time/instance of a zero during the sweep, mark it by storing that iteration i (the little box in the loop structure) into an array. Then you'll use that array (that memory of what was) you've stuffed to go look at the magnitudes of X(f) at those particular places in your discrete X(f) data.
It'd have been more clear had I said "instances," but that's what I meant: instances, i's.
Sounds like a fun project/assignment!
09-30-2022 04:02 PM
One other thing
That sweep is using a shift register but a stacked one, stacked two high. Then it's just a matter of looking at samples n and n-1 and checking for a sign change in the correct direction: mountain, not bowl.
10-02-2022 05:04 AM
Eventually I'll learn how to edit a post, but until then...
dX(f)/df should actually be dMag(X(f))/df. I think you understood that, but just in case you didn't, the FFT returns complex numbers (A+/-jB) which yield the magnitude and phase information of the discrete points [0,N-1]*df. (0*df, 1*df, 2*df, 3*df,..., (N-1)*df) To differentiate the returned function of f, X(f), an array of complex numbers, first calculate C = sqrt(A^2 + B^2), the magnitude, for each element of the array. Then, having the magnitudes in an array, differentiate to get dMag(X(f))/df, which is then used to find the zeroes, at the mountains (not the bowls,) by using sign changes + to -, where in-between is a zero. LabVIEW has tools to do all these things (including finding the zeroes, I think!); however, I was getting the impression you weren't seeing an algorithm to accomplish your objective, so I chimed in.
If only I knew how to edit a post I could put all these added notes in the initial post.
10-02-2022 06:28 AM
By the way,
You said: "so I want to find the product resonance by changing the filter little by little"
That is exactly what the Fourier Transform does. ...exactly.
The continuous Fourier Transform (and mathematicians will cringe hearing this over simplification of mine I am sure) is taking a varying-center frequency, infinite-Q, bandpass filter (BPF) and sweeping x(t), one frequency step (df) at a time, to glean the amplitude and phase information of each sinusoid -- a single sinusoid can be viewed as white noise fed through an infinite-Q BPF -- within x(t). By "taking the Fourier Transform" you are getting the frequency response from, theoretically, an infinite number of such infinite-Q BPFs. One sinusoid (therefore an oscillation at one frequency) is multiplied ("correlated") with x(t), and then the resulting function of time (call it g(t)) is integrated over time to give the area under the g(t) curve. If that area is found to be greater than zero then that particular sinusoid being correlated exists within x(t). It's the calculus of integration from -infinity to +infinity that sweeps an infinite number of such sinusoid correlations across your x(t) to produce X(f).
Now you may still be asking, why -infinity to 0 and then continue on to +infinity, which clearly seems to claim the existence of negative frequencies?! (??) That answer lies in Euler's identity: e^j0 = cos(0) + jsin(0), where here I don't feel like saying theta over and over, so I'm saying "0", instead. The 0 can also be negative, making -0, yielding Euler's identity as e^j(-0) = cos(-0) + jsin(-0) = cos(0) - jsin(0). (I'm assuming you've had trigonometry and can see cos(-0) = cos(0) and sin(-0) = -sin(0).) You'll find if you add (or subtract) those two identities together
e^j0 = cos(0) + jsin(0)
+/-
e^j(-0) = cos(0) - jsin(0)
and then solve for either cos(0) or sin(0), you get that the resulting sinusoid (be it a cosine or sine-type) actually is the sum of a negative frequency (-0) and a positive frequency (0). Hence, to truly get the magnitude and phase contributions of all the sinusoids in your x(t), you must sweep over time = -infinity to +infinity your test-sinusoid f(t) = e^-jwt as correlated with your signal x(t), forming the g(t) that gets integrated to determine the area under each g(t), where each such (complex) area is the contribution of that test-sinusoid, f(t) in x(t).
Hence, you don't need that special filter you sought in the quote at the top, for you already have it. How? You have the power that is the Fourier Transform. Fortunately a couple of brilliant guys back in the 50's/60's determined an algorithm that allows a discrete (separate discontinuous points) form of the continuous Fourier Transform to be taken/run in a very efficient manner called the Fast Fourier Transform, the FFT. That is your means to an end, and, fortunately LabVIEW has the tool included in its Mathematics tools. You feed the tool your double x(t) array and it produces the complex-number array X(f) for you at its output. That X(f) can then be processed as needed to determine the answer you seek, via just a little more math.
10-02-2022 11:19 AM
@3d0g wrote:
By the way,
You said: "so I want to find the product resonance by changing the filter little by little"
That is exactly what the Fourier Transform does. ...exactly.
The continuous Fourier Transform (and mathematicians will cringe hearing this over simplification of mine I am sure) is taking a varying-center frequency, infinite-Q, bandpass filter (BPF) and sweeping x(t), one frequency step (df) at a time, to glean the amplitude and phase information of each sinusoid -- a single sinusoid can be viewed as white noise fed through an infinite-Q BPF -- within x(t). By "taking the Fourier Transform" you are getting the frequency response from, theoretically, an infinite number of such infinite-Q BPFs. One sinusoid (therefore an oscillation at one frequency) is multiplied ("correlated") with x(t), and then the resulting function of time (call it g(t)) is integrated over time to give the area under the g(t) curve. If that area is found to be greater than zero then that particular sinusoid being correlated exists within x(t). It's the calculus of integration from -infinity to +infinity that sweeps an infinite number of such sinusoid correlations across your x(t) to produce X(f).
Now you may still be asking, why -infinity to 0 and then continue on to +infinity, which clearly seems to claim the existence of negative frequencies?! (??) That answer lies in Euler's identity: e^j0 = cos(0) + jsin(0), where here I don't feel like saying theta over and over, so I'm saying "0", instead. The 0 can also be negative, making -0, yielding Euler's identity as e^j(-0) = cos(-0) + jsin(-0) = cos(0) - jsin(0). (I'm assuming you've had trigonometry and can see cos(-0) = cos(0) and sin(-0) = -sin(0).) You'll find if you add (or subtract) those two identities together
e^j0 = cos(0) + jsin(0)
+/-
e^j(-0) = cos(0) - jsin(0)
and then solve for either cos(0) or sin(0), you get that the resulting sinusoid (be it a cosine or sine-type) actually is the sum of a negative frequency (-0) and a positive frequency (0). Hence, to truly get the magnitude and phase contributions of all the sinusoids in your x(t), you must sweep over time = -infinity to +infinity your test-sinusoid f(t) = e^-jwt as correlated with your signal x(t), forming the g(t) that gets integrated to determine the area under each g(t), where each such (complex) area is the contribution of that test-sinusoid, f(t) in x(t).
Hence, you don't need that special filter you sought in the quote at the top, for you already have it. How? You have the power that is the Fourier Transform. Fortunately a couple of brilliant guys back in the 50's/60's determined an algorithm that allows a discrete (separate discontinuous points) form of the continuous Fourier Transform to be taken/run in a very efficient manner called the Fast Fourier Transform, the FFT. That is your means to an end, and, fortunately LabVIEW has the tool included in its Mathematics tools. You feed the tool your double x(t) array and it produces the complex-number array X(f) for you at its output. That X(f) can then be processed as needed to determine the answer you seek, via just a little more math.
The TO has a big different situation.
He can't use the continous FT , he has to use the DFT (discrete fourier transform) in a time limited window.
So his contious signal is foldet twice , first by the sampling (rate and ADC realisation) and second by the window of data he look at.
This results in discrete frequency bins with a df defined by the window length and leakage (all signal content not exactly at that bin frequencies merge into other bins ). (and other nasty stuff like phase noise/jitter effects that most probably don't hurt him in this his applikation)
An object (stucture) is excited (hint) and vibrate at diffenrent frequencies (modal frequencies)
If two frequencies (or some of it's harmonics) are closer than the df defined by the inverse window length, all kind of results can happen in that bin. ( we hear a floating tone, but its two tones)
10-02-2022 07:17 PM
It is known the continuous Fourier Transform cannot be used, because df is 1/infinity (that whole infinite-Q BPF thing;) hence, the Discrete Fourier Transform must be used, instead. df = fs/N, where fs is the sample rate and N is the number of samples. Pick the sampling rate and then make N large and df will approach the continuous/ideal result.
df (the spacing between detectable frequencies) = fs (samples/sec) / N (samples) = 1/time
Leakage will exist, yes, but if df is small, which is had from taking many samples, N, it won't be too bad an issue -- the desired needed mountains will exist, and the derivative will detect them. Recall, the zero slope is had by detecting the sign change of the derivative, from + to -.
Lastly, I goofed again. The LabVIEW FFT and inverse FFT tools are in Signal Processing, not Mathematics.
"˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ" Now that's funny! 🙂
10-02-2022 07:33 PM
One question I have is should a window even be used in this application? Why? That's not a trick question by the way.
10-03-2022 05:07 AM - edited 10-03-2022 05:09 AM
@3d0g wrote:
Eventually I'll learn how to edit a post, but until then...
It's not hard 😁.
Options (right top of the message)>Edit Reply...
10-04-2022 08:55 PM
Thank you everyone.
Thanks, I studied a lot.
I'll practice a little more and come back.
Again, thank you very much. 😄
10-09-2022 05:05 PM
"
It's not hard
.
Options (right top of the message)>Edit Repl
"
Actually it is when the option doesn't exist. You have it. I don't.