Senior Members
  • Content count

  • Joined

  • Last visited

Community Reputation

210 Beacon of Hope

About Enthalpy

  • Rank
  1. Sound Perception

    If you record a long sample and reproduce the whole sample, the reproduction will be good. It's called recording and works decently by now. Taking a direct and inverse Fourier transform of the whole long sample introduces arbitrarily low imperfections, provided you record the phase too, or the complex coefficients. As good as recording. What does not work is when people attempt to fourierize one period of the sound and reduce the information to a harmonic spectrum, because this sound is non-periodic in essence. Synthesis from harmonics creates identical periods - be it one recorded period, or a mean of several periods - which our ears do not accept as a saxophone sound. Any PC has already an ADC in its sound card. Not of recording studio quality, but it suffices to record a saxophone and reproduce a convincing sound. You might for instance record a long tone, identify the pseudo-periods, compute a mean value, and observe that the mean period does not sound like a saxophone or a recorder. It doesn't even need a Fourier transform. Researchers at a Brittany university claimed (I didn't hear it) they obtained a more convincing violin sound by taking a sawtooth signal and letting a random noise decide the instant of the transition.
  2. Quasi Sine Generator

    At last, +-1 waveforms that reduce nicely H3, H5 and H7. They take 21 transitions per half-period but only T=210. H3 H5 H7 H1 T a b c d e f g h i j ================================================================= -104 -inf -inf 0.73 210 2 7 14 16 19 20 26 28 42 43 <<<<< -110 -inf -inf 0.23 210 8 10 14 22 32 34 38 41 42 46 <<<<< ================================================================= The amplitudes of H5 and H7 are algebraic zeros almost certainly. The first waveform has its H9 some 23dB below H1, while the second has a weaker H1, about 10dB below H9. A 6 bits up-down counter takes only 11 big And gates to define all the transitions. -------------------- The harmonics that are zero to the rounding accuracy with 64-bits floats remain so with 80-bits floats, both here and for the previous waveform that suppresses H3 and H5 using 11 transitions. Marc Schaefer, aka Enthalpy
  3. Sound Perception

    Hi John Cuthber, thanks for the link! The following archive packs a wav file of the three notes synthesized from their harmonic spectrum given at Hyperphysics. Windows Media Player and others can play the wav file. The archive contains also the exe file that can run within Windows' console: cmd.exe. The provided shortcuts Cmd2k and CmdXp start the console from usual W2k and Xp installations and hopefully from other Windows. If the shortcuts are in the exe's folder, type tute in the console to start the executable that creates tut.wav. h in tute displays help, q quits. Type exit to quit the console. The joined txt has the commands (in dB) for the exe to make the sounds described at Hyperphysics. Copy the contents in a text editor, paste by right-clic when tute.exe awaits commands. The joined cpp is the source file. Plain Unix-styled C, so it should be compilable to run on Linux and elsewhere. HyperphysicsSaxophone.zip Hearing the wav tells that the harmonic spectrum, making a periodic signal, remotely suggests the tone colour of a saxophone, but can't imitate it.
  4. Sound Perception

    If one records the whole sound, transforms it by Fourier in the frequency domain and back in the time domain, it reconstitutes the record, up to minimizeable imperfections. But if one records only one or few pseudo-periods, the Fourier transform implicitly supposes that these represent a part of a periodic signal, which is the wrong start. In addition, a pseudo-period length must be cut very accurately, lest the step where the ends meet introduces high harmonics - and the limited sampling rate limits this adjustment.
  5. Sound Perception

    Here are sounds with variable degree of distortion, and the source TutE.cpp to produce them. Distortion.7z All at 330Hz. The files Saw contain 15 harmonics like a sawtooth signal, Sine have only the fundamental. Mild is a very smooth deformation by a hyperbolic sine, while Hard is clipping. Beginning with none, the distortion increases in 2s intervals. Clipping removes the extreme 0%, 0.2%, 0.5% and 1% of the voltage in 2s intervals. It gets noticeable when 0.5% of a sine are removed, or 0.2% once you know what to listen at. The sound that has already harmonics is unaffected by 1% clipping. This distortion appears only when the amplifier saturates. Thanks to feedback, crossover in a class AB amplifier doesn't create such a distortion. Not even computer audio makes that much. Our ears detect around 0.2%, but only on a sine wave. Mild saturation reduces the gain very progressively at the extreme voltages: here it removes 0, 3%, 10% and 40% of the peaks before rescaling, in 2s intervals. This distortion, which introduces harmonics of lower rank, gets noticeable at 10% compression, wow, and on the sawtooth not even at 30%. Audio electronics doesn't create such a distortion, thanks to feedback. Loudspeakers would if extremely overdriven, but we aren't sensitive to that. So whether an audio amplifier shows 0.1% or 0.01% distortion is only marketing. As opposed, an electric guitar amplifier operates generally in saturation. Transistor end stages clip the wave while vacuum valves saturate more smoothly. I haven't heard the difference personally up to now, but based on the samples here, I easily believe that valves sound differently in a guitar amplifier. Well, we could just saturate the signal smoothly before sending it to a transistor amplifier. Marc Schaefer, aka Enthalpy ========== Hi JC, Swansont and the others, I come back soon!
  6. Sound Perception

    What height difference do we perceive, and how accurate shall instruments be? Here are some favourable cases, where the same note is slightly raised between 1s-2s and between 3s-4s. Permil.7z The free 7-zip archiver expands the 7z format. If someone needs the bigger zip file, please tell me. www.7-zip.org The files Permil1, Permil2 and Permil5 raise the note by 0.1%, 0.2% and 0.5%. Those called Harm contain the harmonics 2, 3, 4, 6, 8 too. The height is a 440Hz A except for the files H2 (880Hz) and H4 (1760Hz). You may hear the height much better at the sounds with harmonics (at least I do). Is it because more Hz separate the harmonics? Probably not, since our height perception is closely logarithmic - in all cultures, from what is published. Anyway, I perceive the 0.2% raise better at 880Hz sine and even better at 1760Hz, almost as clearly as at the harmonic-rich 440Hz tone (whose harmonics 6 and 8 are weak). So a better height sensitivity to a fundamental or harmonics around 1760Hz would be a decent explanation within this limited experiment. How much? When I was young and played the violin, I could hear 0.1% at a 440Hz sine, now I need the harmonics, sob. The cent is also near our limit, reportedly; defined as 1/100 of a 1+0.059 half-tone, or 0.059%. Is it innate or trained? Rather both. Violinists switching for the first time to the alto have immediately an accurate height perception on the new notes, while on the cello it takes little time. And what about flautists who get used to their too low high G# and don't notice it any more? On the other hand, some violinists (...even very famous) don't hear the height well after decades of training. Some people, mostly violinists, claim to perceive the absolute height rather than intervals. From my experience, they don't tune by far as precisely as when referring to a standard. Also, a violin gives hints to the absolute height: its resonances differentiates the notes, and the strings sound more brilliant with more tension. So I formulate the hypothesis that these violonists are guided by their instrument - until I see or read further experiments. Our excellent perception of tone height makes the manufacture of instruments difficult: 0.5% (8 cent) detune would be bad, but for simple woodwinds, wavelengths predict the height to 10%, and the rest is professional knowledge. A known recipe for good woodwinds is that their harmonic resonances are aligned. Though, they play notes at least on two resonance modes, and the musician changes the embouchure between both, which modifies the reed's susceptance and the resonance's height http://www.scienceforums.net/topic/112039-woodwind-reed-susceptance/ so the good tune of the two octaves or twelfths can hamper the mode alignment. While I haven't seen that in books, I expect many instrument makers to know it. Marc Schaefer, aka Enthalpy
  7. Hear Wagnertuben

    Wagnertuben (lower horns essentially) were ordered by ol' Richard for his operas. Bruckner and a handful more composers used them too. They would deserve wider use: nice sound, range not covered by similar instruments, and (I believe) available in many symphonic orchestras. Anyway, here are opportunities to hear them clearly: https://www.youtube.com/watch?v=mmLRtqGOAJk only music https://www.youtube.com/watch?v=Hifo18bVG80 some waffle (in German) https://www.youtube.com/watch?v=j-4xZD6BX_w begins 4:50, with some waffle (in German) https://www.youtube.com/watch?v=MFm2C-ve7qw 0:00 to 1:40 with waffle (in German) and from 6:23
  8. Sound Perception

    Why? Air isn't dispersive at these frequencies under usual conditions. We write waves as Psi(t-x/c) which keeps the relative phases over the distance, or equivalently, keeps the signal shape. That is, if a harmonic crosses zero at Phi degrees after the fundamental does, one metre further it will still lag by Phi degrees. If changing only t or x/c, the phase turns more quickly for higher harmonics, but if following the sound propagation, at constant t-x/c, Phi keeps the same, and the signal shape too. That's observation rather than logic. Attempts to synthesize a musical sound from its harmonic spectrum, which can only produce a periodic signal, fail to imitate a musical sound. It's the very reason why present-day electric organs have samples of physical instruments in memory for each note and play these samples on the musician's demand. It's because other methods failed. I suggest to tinker with my piece of software. It lets adjust any harmonic at will to produce any periodic sound. Agreed. I must make some day the experiment of inverting one loudspeaker phase. It's said to be audible, but so many claims are unverified in Hi-Fi. My programme (TutD.zip in the first message here) only softens the attack and extinction of the notes because sudden amplitude changes are uncomfortable and distract the listener. Function WrWav, loops for (... envel *= DecRate) for (... envel /= DecRate) The envelope of a sound is very important to its character, agreed. But a long steady sound of a saxophone or flute can't be mistaken with a periodic signal. So the difference doesn't reduce to the envelope.
  9. Sound Perception

    Many sources claim that when tuning a piano, the high octaves must be stretched out to sound in tune because the human ear perceives the intervals smaller there. So here are some intervals in the two last or the last octaves of a piano. The height of these sine signals is less clearly perceived, but harmonics would be unbearable. The notes follow the equally tempered scale, where the quart and quint intervals differ by 0.1% from 4/3 and 3/2. HighOctavesStretching.zip I hear these intervals in tune. No need to stretch the high octaves. Marc Schaefer, aka Enthalpy
  10. Sound Perception

    Barry Stees put bassoon spectra on the Web (thank you!): http://steesbassoon.blogspot.de/2012/08/seeing-sound.html of which I pick the "good reed" graph of a C note (130.8Hz, mid-staff of bass key, a bassoon reaches an ninth lower) and misuse it as is for other notes, up to the oboe's high G. H | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 ======================================================================================== dB | -51 -38 -29 -24 -36 -38 -53 -52 -51 -53 -58 -59 -63 -59 -65 -61 -76 -69 -79 -87 -80 ======================================================================================== t (s) 0 1 2 *** 4 5 6 7 8 9 10 11 =================================================================== Note | C G C G C G C G C G Freq | 65.4 98 130.8 196 261.6 392 523.3 784 1047 1568 =================================================================== BassoonRaised.zip This synthesis from a harmonic spectrum, making a periodic signal, again suggests but can't imitate a musical sound. And here too, the timbre of the same spectrum depends on the pitch, becoming strident on high notes. -------------------- Now, in these high notes, I suppress the harmonics above a cutoff frequency. Note Cutoff =========================== 0s-1s | C 523Hz | none 1s-2s | C 523Hz | 6kHz 2s-3s | C 523Hz | 4kHz 3s-4s | C 523Hz | 3kHz --------------------------- 4s-5s | G 784Hz | 6kHz 5s-6s | G 784Hz | 4kHz 6s-7s | G 784Hz | 3kHz --------------------------- 7s-8s | C 1047Hz | 6kHz 8s-9s | C 1047Hz | 4kHz 9s-10s | C 1047Hz | 3kHz --------------------------- 10s-11s | G 1568Hz | 6kHz 11s-12s | G 1568Hz | 4kHz 12s-13s | G 1568Hz | 3kHz =========================== BassoonRaisedCutoff.zip Strident harmonics begin somewhere between 3kHz and 4kHz, independently of the fundamental frequency. That's also the highest note of most instrument families: I know only the celesta, glockenspiel and violin to exceed it. The varied cutoff frequencies often change just one or two harmonics. This bassoon spectrum, with amplitudes increasing to the 4th harmonic and decreasing slowly, is artificial and aggressive on high notes. Double reeds, with their wide spectrum, need a filtering air column more than single reeds and flutes do. This filtering eases the wider range of bass instruments; other causes are more direct. Marc Schaefer, aka Enthalpy
  11. Sound Perception

    I've finally checked that I don't hear neither a fundamental at 10kHz, 12kHz, 15kHz with my setup. It results more from the loudspeakers and headphone than from my age (adults didn't hear the 15kHz hiss of TV sets when I was a teen) because one side cuts earlier than the other, and when I swap them it follows the headphone. So harmonics above 10kHz are unlikely perceived. My headphones resonate at 3500Hz, less around 250Hz, and they (and the ears) get weaker below. If the volume is set for 300Hz, 60Hz is nearly inaudible. The loudspeakers are again worse. -------------------- Here I tweak an oboe spectrum transposed to 220Hz: the same measures by Kendall Milar, played one octave lower, in the baritone oboe's range. Stronger harmonics 8 to 15 make the timbre richer and more open but not strident as at 440Hz, while weakening them produces a muffled tone. The harmonics 21 to 28 (6kHz) make now a tiny difference despite being 60dB below the strongest one, and if amplified to -55dB they make the sound strident. H | 1 2 3 4 5 6 7 | ============================================ Always | -37 -23 -20 -29 -39 -47 -44 (dB) ============================================ H | 8 9 10 11 12 13 14 15 | ============================================ 0s-1s | -38 -36 -40 -45 -49 -59 -55 -65 | (+10dB) 1s-2s | -48 -46 -50 -55 -59 -69 -65 -75 | Measured 2s-3s | -58 -56 -60 -65 -69 -79 -75 -85 | (-10dB) 3s-end | -48 -46 -50 -55 -59 -69 -65 -75 | Measured ============================================ H | 21 22 25 27 28 | ================================ 0s-4s | (nothing) | 4s-5s | -80 -80 -80 -80 -80 | Measured 5s-6s | -65 -65 -65 -65 -65 | (+15dB) 6s-7s | -55 -55 -55 -55 -55 | (+25dB) ================================ OboeLower220Hz.zip -------------------- Now the same oboe spectrum is transposed to 110Hz: two octaves lower, in the bassoon's range. Without harmonics 8 to 15 (0.9 to 1.7kHz) it sounds uncomplete. Their amplitude measured from the oboe doesn't suffice; adding 10dB makes a more normal sound, not at all strident like at 440Hz. The harmonics 21 to 28 (2.3 to 3.1kHz) matter a little bit at their measured amplitude. At -55dB, the sound is abnormal but not strident. Adding harmonics 30 to 90 (3.3 to 10kHz) at -65dB makes the strident sound; a credible sound needs the harmonics 21 to 28. H | 1 2 3 4 5 6 7 | ============================================ Always | -37 -23 -20 -29 -39 -47 -44 (dB) ============================================ H | 8 9 10 11 12 13 14 15 | ============================================ 0s-1s | (nothing) | 1s-2s | -48 -46 -50 -55 -59 -69 -65 -75 | Measured 2s-end | -38 -36 -40 -45 -49 -59 -55 -65 | (+10dB) ============================================ H | 21 22 25 27 28 | ================================ 0s-3s | (nothing) | 3s-4s | -80 -80 -80 -80 -80 | Measured 4s-5s | -55 -55 -55 -55 -55 | (+25dB) 5s-7s | -80 -80 -80 -80 -80 | Measured 7s-end | -65 -65 -65 -65 -65 | (+15dB) ================================ H | 30 40 51 63 76 90 | ==================================== 0s-6s | (nothing) | 6s-8s | -65 -65 -65 -65 -65 -65 | Arb ==================================== OboeLower110Hz.zip -------------------- So the frequency more than the rank makes unpleasant harmonics. Marc Schaefer, aka Enthalpy Hi everyone, I'm coming back soon!
  12. Sound Perception

    PC hardware is always of bad quality. Price dominates everything. And since the signal comes from a PC hence is full of electric noises, I wouldn't invest in good headphones. That said, headphones are by nature far better than loudspeakers. Especially, the box size doesn't limit their band at low frequencies, nor do headphones show huge resonances. To synchronize with the fundamental the harmonics of varied phases, the headphones would need a strongly non-linear operation. Such a huge non-linearity would be noticed. Feel free to connect a Hi-Fi amplifier and loudspeakers to the PC, or to transfer the wav files to your Hi-Fi Cdrom reader, and check what you hear there. Mathematic? Mathematicians are highly welcome in this thread! Figures give strong evidence that the suppression of low harmonics has algebraic solutions, but as an old engineer, I didn't try longer than five minutes. Rational numbers and cosines don't mix so easily, 7th grade equations neither. My piece of soft does that, just with a few added bangs and whistles to change the amplitudes more conveniently. But a different experiment would be a welcome double-check of course.
  13. Quasi Sine Generator

    I had wanted T=4n for bad reasons. T=2n suffices and enables new combinations. Improving slightly over Jan 22, 2018: T=374 gives weaker H3, H5, H7 with 11 transitions than T=344, while the bigger T=856 and T=1092 still outperform both. Still the dumb software, run up to T=1040. ================================================== T a b c d e H3 H5 H7 H1 ================================================== 374 14 32 34 42 46 -73 -91 -82 0.82 ================================================== ---------- I've tried 15 transitions to minimize H3, H5, H7 with T=2n. Only up to T=434, which less stupid software would relieve. 15357.cpp ====================================================== H3 H5 H7 H1 T a b c d e f g ====================================================== -75 -73 -72 0.55 222 4 12 18 31 35 49 51 -84 -81 -96 0.81 368 11 25 30 45 46 49 51 -80 -inf -inf 0.49 420 7 18 37 47 70 77 102 -100 -73 -75 432 11 30 32 33 41 76 80 ====================================================== Found no exact solution: only -81dBc with T=368. The number of trials is too small to squeeze three harmonics by chance. Marc Schaefer, aka Enthalpy
  14. Sound Perception

    Kendall Milar published some oboe spectra (thank you!) https://ida.mtholyoke.edu/xmlui/bitstream/handle/10166/715/257.pdf of which I fed the fig. 23 (page 41/88 in the pdf) in my synthesis software: the spectrum of a 440Hz A, comparing wood with plastic bodies there. Elsewhere, that report compares the spectra among musicians, reeds, instruments. ---------- My soft synthesizes a periodic signal from a spectrum. This can vaguely suggest an oboe, a clarinet, a trumpet. It can't imitate a flute, a saxophone, a violin, even on a steady note. All combinations of harmonics amplitudes result in a dead, artificial, synthesizer-like sound. I tried - try it too to get convinced. A musical sound is by nature non-periodic, hence a harmonic spectrum doesn't represent it. Time to progress beyond Helmholtz hence. At least one group (university in Brittany) imitated a violin better with a non-periodic signal. Nevertheless, the harmonic spectrum contains some hints about sounds and instruments and is relatively simple. ---------- Even on a throat note (first octave A), this oboe has its harmonics 2, 3 and 4 stronger than the fundamental. I tried to make the fundamental 10dB stronger and weaker than the measure: H | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 ====================================================================== 0s-2s | -27 (dB) 2s-4s | -37 -23 -20 -29 -39 -47 -44 -48 -46 -50 -55 -59 -69 -65 -75 4s-6s | -47 ====================================================================== OboeA440_Fund_10dB.zip The weak fundamental is part of the narrow, elegant oboe sound. ---------- Adding (2s-4s) the harmonics 21, 22, 25, 27, 28 at 60dB below the harmonic 3 makes no perceivable difference. They begin at 9kHz, where our ear is less sensitive but headphones hopefully not too bad. OboeA440_H21H28_60dB.zip ---------- In this comparison, the harmonics 8 to 15 are stronger (0s-2s) or weaker (4s-6s) than the measure: H | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 ====================================================================== 0s-2s | (dB) -38 -36 -40 -45 -49 -59 -55 -65 2s-4s | -37 -23 -20 -29 -39 -47 -44 -48 -46 -50 -55 -59 -69 -65 -75 4s-6s | -58 -56 -60 -65 -69 -79 -75 -85 ====================================================================== OboeA440_H8H15_10dB.zip Damping these harmonics (>3.3kHz in this case) changes the sound from strident to rich to muffled. As far as a periodic signal lets tell, it's much of the difference between most double reed instruments, often with wider bore and tone holes, and an oboe. As my figures suggest https://www.scienceforums.net/topic/113115-intentional-losses-in-wind-instruments/?do=findComment&comment=1035629 the chambers at the oboe's tone holes contribute to this function very efficiently. Marc Schaefer, aka Enthalpy Hi Mathematic and JC, thanks for your interest! Replying soon.
  15. Quasi Sine Generator

    Random noise is often stronger than the harmonics, yes. But in some uses, often with a narrow band, the harmonics dominate. Measuring very weak harmonics is not easy, I had already to invest some time in it. The and (or the xor) of two fast squares is, after removing the high frequencies, a triangle, full of harmonics. Making a product (call it heterodyne) of two approximate sines makes a better sine. But with squares, both third harmonics beat too and produce a third harmonic of the beat frequency.