DSPRelated.com
Forums

Java Audio question - PLEASE HELP

Started by cppt...@yahoo.com April 13, 2008
On Apr 23, 2:48&#4294967295;pm, "cpptutor2...@yahoo.com" <cpptutor2...@yahoo.com>
wrote:
> With reference to all the postings I am sorry I have caused confusion..
One way to 'cut through the c..onfusion' is to post an SSCCE. More info here http://sscce.org/ Have one peice of code to generate the tone, and a second to do the transform. -- Andrew T.
Andrew Thompson wrote:
> http://sscce.org/
Swee-eet. -- Lew
Lew wrote:

> cpptutor2000@yahoo.com wrote: >> On Apr 22, 11:04 pm, Lew <l...@lewscanon.com> wrote: >> >>>> fs = sample rate in Hz >>>> dT = 1/fs = interval between samples >>>> N = number of samples taken >>>> T = N x dT = total time period >>>> f1 = 1/T = frequency of the first harmonic in Hz >>> So if you accumulated twice as many samples, over twice as long, your >>> fundamental frequency would be halved? That is not sensible. >>> >>> -- >>> Lew >> That is precisely the case. Please check the definitions above. Please >> note that f1 is the first harmonic if I were to calculate an FFT with >> the collected samples. The fundamental frequency is 500.0 Hz, and >> stays that way. > > No, that doesn't make sense. If I recorded a pure 1000 Hz sine wave, that is > the frequency whether I take 44000 samples for one second or 88000 samples > over two seconds. The frequency isn't affected by how long I record it. >
The frequency *resolution* is, though. That's what the OP was referring to [rather obliquely]. The OP mistakenly calls this the fundamental frequency. The sampling rate determines the bandwidth, and the maximum freq. which you can capture (Nyquist-Shannon). The overall length (in time, not samples) determines the frequency resolution (Fourier). -- Nigel Wade
Jerry Avins wrote:
(snip)

> It would help if you used the same terms that the rest of us do. In > particular, it is important to avoid using standard words in > non-standard ways without the sort of glossary you provided here.
> *Fundamental* applies not to an FFT, but to the longest-period component > of a periodic waveform. What *you* have called the fundamental is often > referred to as bin width or resolution.
It does make some sense in the context of the FFT, though. Since FFT has periodic boundary conditions, the lowest non-zero frequency could be considered the fundamental. Those who apply the FFT to non-periodic signals get what they deserve.
> If your signal repeats every 2 ms, then its fundamental is 500 Hz. It > may have harmonics at 1000, 1500, 2000Hz, etc.
-- glen
On Apr 24, 1:16 pm, glen herrmannsfeldt <g...@ugcs.caltech.edu> wrote:
> Jerry Avins wrote: > > (snip)
> > snip
> It does make some sense in the context of the FFT, though. > Since FFT has periodic boundary conditions, the lowest non-zero > frequency could be considered the fundamental.
In the OP's description, 500 Hz is the lowest non-zero frequency :,). And it is the 'fundamental of the signal', as opposed belonging to the set of 'fundamental frequencies of the transform', of which zero is included as a member. Does anyone have a suggestion for a description of this area of vocabulary that is: 1) accessible (free, etc.) 2) complete enough for this level of discussion 3) unambiguous 4) at a suitable level for the OP?
> Those who > apply the FFT to non-periodic signals get what they deserve. >
Those who have known how to apply the FFT to non-periodic signals have made much good use of it.
> -- glen
Dale B. Dalrymple
On Apr 24, 4:33&#4294967295;pm, Lew <l...@lewscanon.com> wrote:
> Andrew Thompson wrote: > >http://sscce.org/ > > Swee-eet.
I thought you (amongst others) might like that URL. It is Dave Minter's mirror of the SSCCE. Thanks Dave! -- Andrew T.