Active questions tagged wave - Signal Processing Stack Exchange most recent 30 from dsp.stackexchange.com 2019-07-22T21:36:15Z https://dsp.stackexchange.com/feeds/tag/wave http://www.creativecommons.org/licenses/by-sa/3.0/rdf https://dsp.stackexchange.com/q/59203 1 Where should triangle, sawtooth and square waves start? Lars Ericson https://dsp.stackexchange.com/users/35967 2019-07-01T17:23:16Z 2019-07-03T20:24:39Z <p>I am reading <a href="https://github.com/AllenDowney/ThinkDSP" rel="nofollow noreferrer">a text on DSP</a>, which shows generation of sin, cos, triangle, sawtooth and square waves. Generated cos waves start at 1 and sin waves start at 0, which makes sense (cos(0)=1, sin(0)=0). Generated triangle waves start at 1, square waves at -1, sawtooth at -1. Wikipedia gives <a href="https://en.wikipedia.org/wiki/Square_wave" rel="nofollow noreferrer">a number of constructions</a> for square wave, which would lead to starts at 1, -1 or 0.</p> <p>Is there a convention in the DPS/electrical engineering/oscillosope world on where triangle, sawtooth and square waves should start?</p> https://dsp.stackexchange.com/q/36640 2 How audio watermarks are captured sravis https://dsp.stackexchange.com/users/25717 2017-01-02T17:47:46Z 2019-04-28T21:03:25Z <p>I have read that we can use audio watermarks to "identify the original produces of the material or the consumers of the media."</p> <p>How <strong>consumers of the media</strong> is measured by audio watermarks?</p> <p>Lets say in TV we play an video which has audio watermark in it and 100's of people are watching it. How do we capture the audio watermark that got played in viewers TV?</p> https://dsp.stackexchange.com/q/38894 0 Get dB full scale value of a group of wave samples WaspCo https://dsp.stackexchange.com/users/27675 2017-04-02T11:25:09Z 2019-04-26T03:02:05Z <p>I am trying to compute the dBFS value of a group of samples (stereo wave file), according to this formula:</p> <p>$$p_{RMS} = \sqrt{\frac{ x_1^2 + x_2^2 + \ldots}n }$$ $$dbFS = 20\log_{10}\frac{ p_{RMS}}{p_{max}}$$</p> <p>The value I get is wrong, and not stable (I am using a stereo constant -18dbFS 1000H sinewave audio file). I know the input/output of the program is working, because I did an fft on a music file and the output is fine.</p> <pre><code>float get_db(Header *header, unsigned int *buffer_size, int32_t left[], int32_t right[]) { unsigned int i = 0; float dbfs = 0; //From -144 to 0dbfs double pmoy = 0; double pmax = 0; pmax = maxint(header-&gt;bits_per_sample); //Max positive range of sample, here it is 8388608 for (i=0; i &lt; *buffer_size; i++){ //Buffer size of 4096 here pmoy =+ pow(left[i], 2); //Just the left channel for now } printf("sum= %f\n", pmoy); //temporary sum pmoy = sqrt( pmoy / *buffer_size); printf("pmoy= %f\n", pmoy); //pmoy rms of 4096 samples dbfs = 20 * log10( pmoy / pmax); return dbfs; } </code></pre> <p>I really don't understand why I don't get a constant value of -18dBFS. I am still learning C, there should be some obvious reasons and I hope you could help me. Is there a normalized definition of a dBFS scale for discrete values, and a particular integration time that should be used ? </p> https://dsp.stackexchange.com/q/56455 0 Need help with detecting onset of audio in wav file PhoenixProject https://dsp.stackexchange.com/users/41488 2019-04-05T00:36:37Z 2019-04-05T00:36:37Z <p>I'm new to DSP and I'm learning as I go. I have an audio file with a chirp signal(2kHz). I played and recorded this chirp signal and the recording has a lot of environmental sounds.</p> <p><a href="https://repl.it/@NEHANIPHADKAR/ChirpDetection" rel="nofollow noreferrer">Here is my code:</a></p> https://dsp.stackexchange.com/q/31556 6 Can you turn a square wave into a sine wave using a low pass filter? Mark https://dsp.stackexchange.com/users/22511 2016-06-16T08:03:52Z 2019-02-27T20:02:43Z <p>And if it could, would it make the sound of the square wave thinner than before because of losing its harmonics?</p> https://dsp.stackexchange.com/q/55417 3 Why do waveforms that are symmetrical above and below their horizontal centerlines contain no even-numbered harmonics? robert https://dsp.stackexchange.com/users/40513 2019-02-11T05:40:49Z 2019-02-12T06:13:26Z <p><a href="https://www.allaboutcircuits.com/textbook/alternating-current/chpt-7/more-spectrum-analysis/" rel="nofollow noreferrer">All About Circuits</a> site states that waveforms that are symmetrical above and below their horizontal centerlines contain no even-numbered harmonics. Can somebody explain this mathematically, or point to a resource? I do not know much about dsp, but understand what a Fourier transform is.</p> https://dsp.stackexchange.com/q/54874 -1 are Ultra sound signal amplitude dangerous? [closed] Makhlouf GHARBI https://dsp.stackexchange.com/users/26255 2019-01-16T19:15:31Z 2019-01-16T19:36:31Z <p>First sorry if this question if it's out of topic but I'm very intrigued </p> <p>The human ear can hear a specific range of sound waves frequency. and huge amplitude of those sounds can damage the ears</p> <p>but the ultrasound waves that the ear could not hear, if their amplitude exceeds 100dB for example, my question is :</p> <ul> <li>couldn't that be a huge danger too to the ear?</li> <li>if so, since we can't hear the sound, how can we react to that danger !!!!</li> </ul> https://dsp.stackexchange.com/q/2051 7 Why does a wave continuously decreasing in frequency start increasing its frequency past the half of its length? rotor https://dsp.stackexchange.com/users/1235 2012-04-13T21:32:06Z 2018-12-24T09:12:26Z <p>I'm trying to programmatically generate a wave (sine or square) with a continuously decreasing frequency. To do so, I simply multiply the starting frequency for a decreasing value, that linearly goes from 1 to 0, at intermediate steps throughout a given time span. I was puzzled to see (and hear) that, exactly at the half of the time span, the frequency started to increase again. I checked the frequency value but everything is ok. I can use only the first 'half' of the wave, but it would be great to understand what I'm experiencing. Any help appreciated ! Thanks</p> https://dsp.stackexchange.com/q/52935 -2 difficulty in understanding amplitude, frequency and period snr https://dsp.stackexchange.com/users/38513 2018-10-29T11:18:07Z 2018-10-29T12:14:34Z <p>I have difficulty in understanding of some fundamental terms as amplitude. Can be there more than one amplitude for a signal? The following expression is combination of 3 sinusoidal signal, so are there 3 different amplitudes, periods or frequencies?</p> <p><span class="math-container">$h(x) = \sin\frac{2\pi x}{23} + \sin\frac{2\pi x}{28} + \sin\frac{2\pi x}{33}$</span></p> <p><a href="https://i.stack.imgur.com/67aKE.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/67aKE.png" alt="enter image description here"></a></p> https://dsp.stackexchange.com/q/52914 0 Is it possible to encrypt an audio wave? NFL Example steve antwan https://dsp.stackexchange.com/users/38496 2018-10-28T15:39:18Z 2018-10-28T16:28:27Z <p>In the NFL, quarterbacks receive playcalls from coaches over their helmet's wireless interface. </p> <p>Someone mentioned how occasionally, these radios will pick up interference from airplanes, and that frequently the helmets lose communication. </p> <p>One thing I wonder about is if an opposing team's coaches could pick up what was being communicated between the offensive coordinator and the quarterback. </p> <p>And then I wonder, well, why wouldn't there just be an encryption scheme between the coach and the quarterback. </p> <p>A chip on the coach's side would take his voice, encrypt it, send it to the quarterback's helmet, in which a matching chip would decrypt it. </p> <p>Obviously there are tons of other applications, military, etc.</p> <p>But then I wonder if the encrypted signal would be distorted with all this noise, and if that distortion would completely disrupt the decrypted signal.</p> <p>Because if you change even a bit in an encrypted signal, it would obfuscate the resulting signal when it was decrypted by the quarterback's helmet.</p> <p>Are there any methods for this kind of "loose encryption"? </p> <p>There are "human" encryption schemes. Like NFL coaches <em>could</em> change the name of their plays from game to game. This would keep it known to only the QB and the coach. </p> <p>But I guess I was wondering if there was a mathematical approach.</p> https://dsp.stackexchange.com/q/52288 0 frequencies in sound: multiple possibilities? Kroma https://dsp.stackexchange.com/users/37947 2018-09-29T14:29:57Z 2018-10-01T11:41:35Z <p>First, I am by no mean a sound engineer (as you will guess later).</p> <p>I was just wondering something while looking at the waveform of a .wav</p> <p>for a given shape of waveform on a duration of 2 sec for example, how can we make sure that the frequencies fft gives are the only correct one? what if very little parts of a sinusoid could be considered instead of a full continuous sinusoidal movement that just varies in amplitude? or, what if a sinusoid had a lot of very fast varying amplitudes ?</p> <p>that would lead to an infinity of solutions I guess..</p> https://dsp.stackexchange.com/q/51643 0 Extracting metadata from wav files [closed] Cody Rutscher https://dsp.stackexchange.com/users/37459 2018-08-30T20:59:55Z 2018-08-31T01:57:05Z <p>I was curious if there is a way to extract metadata from wav files. For instance, can you get bpm, key, instrument, etc. from a .wav file on upload?</p> https://dsp.stackexchange.com/q/51539 1 how to extract a period of a periodic pulsed signal? Natalia Molinero Mingorance https://dsp.stackexchange.com/users/11502 2018-08-27T12:44:50Z 2018-08-27T14:27:30Z <p>I rercorded a sequence of zeros and ones which is repeated many times. However, the first and the last repetitions may not be complete because I have to start recording at a random time, so the sequence can be started when I hit record and the sequence may have not finished when I stop recording.</p> <p>I'd like to know how to extract, for instance, the 3rd period of the complete recording, because this is something I know it would have the complete sequence.</p> <p><a href="https://drive.google.com/file/d/1PZ272m73fI68fNIEaGLl5uH3JUiH2ezW/view?usp=sharing" rel="nofollow noreferrer">here</a> is a example of the signal I'm working with. I computed the FFT and I think the frequency is 96000Hz (half of the sampling rate), but still I'm not sure how to extract a complete period from it.</p> <p>How could I do this?</p> https://dsp.stackexchange.com/q/44052 1 When simulating a voltage divider using wave digital filters I get inversed polarity outputs Matheus Oliveira da Silva https://dsp.stackexchange.com/users/31089 2017-09-30T13:35:02Z 2018-05-09T19:14:45Z <p>I'm studying wave digital filters for my bachelor's thesis and I'm finding problems in implementing a voltage divider to test my knowledge.</p> <p><a href="https://i.stack.imgur.com/sc36z.jpg" rel="nofollow noreferrer">Here's the circuit that I'm trying to simulate and the WDF tree that I think it's valid</a></p> <p>To simulate the circuit above I created the following matlab code</p> <pre><code>clear all t = [0:0.1:10]; f = 10000; fs = 100000; n = length(t); % Resistance of resistors (duh) Rv = 10e3; R1 = 10e3; R2 = 10e3; % Voltage input V = sin(2*pi*f/fs*t); % Initialize arrays Ac = zeros(1,n); As2 = zeros(1,n); Br2 = zeros(1,n); Ar2 = zeros(1,n); Bs2 = zeros(1,n); % Series connector port resistances Rps1 = Rv; Rps2 = R1; Rps3 = R2; % Series connector port scattering parameters lps11 = (2*Rps1) / (Rps1 + Rps2 + Rps3); lps12 = (2*Rps2) / (Rps1 + Rps2 + Rps3); lps13 = (2*Rps3) / (Rps1 + Rps2 + Rps3); % Iterates over the whole input wave for i=2:n % Inputs waves to the series connector As1 = V(i); As2(i) = 0; As3(i) = 0; % Reflectes waves to the series connector Bs1 = As1 - lps11*(As1 + As2(i) + As3(i)); Bs2(i) = As2(i) - lps11*(As1 + As2(i) + As3(i)); Bs3(i) = As3(i) - lps11*(As1 + As2(i) + As3(i)); end % Calculates output voltages over resistors Vr1 = (Bs2+As2)/2; Vr2 = (Bs3+As3)/2; % Plot outputs subplot(2,1,1); plot(t,V); subplot(2,1,2); plot(t,Vr1); </code></pre> <p>Which gave me the following output</p> <p><a href="https://i.stack.imgur.com/CxUvh.jpg" rel="nofollow noreferrer">The first plot is the input voltage and the second is the output voltage over one of the resistors </a></p> <p>As can be seen the magnitude of the output is the same as expected (1/3 of the input), but the signal is multiplied by -1.</p> <p>Is there something fundamentally wrong that I'm doing so that even the simplest circuit can't be correctly simulated?</p> https://dsp.stackexchange.com/q/48760 0 Windows Audio WAVEFORMAT buffer BYTE to 16-bit int blisstdev https://dsp.stackexchange.com/users/35330 2018-04-25T03:11:49Z 2018-04-26T03:20:37Z <p>I am trying to understand audio-buffer processing at the low-level for the first time.</p> <p>I have the following C++ code copying WAVE-format byte data from <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/dd370859(v=vs.85).aspx" rel="nofollow noreferrer">capture buffer of Window Core Audio</a> (*ppData in that documentation), into an "AudioSink."</p> <p>Could someone explain what's happening here (the "WHAT'S GOING ON HERE" in the code)?<br> I'm confused as to why this works, how the number of channels, number of frames, and the conversion between <code>BYTE</code> and <code>int16</code> factor into the calculation? I need to eventually convert this into <code>float</code> data so I need to understand what is happening!</p> <p>Thank you!!!</p> <pre><code>int AudioSink::CopyData(const BYTE* Data, const int NumFramesAvailable) { // Data is the ppData returned pointer from IAudioCaptureClient::GetBuffer std::lock_guard&lt;std::mutex&gt; lock(m_mutex); AudioChunk chunk; if (Data == NULL) { chunk.size = 0; m_queue.push(chunk); return 0; } // ***** WHAT'S GOING ON HERE ******* chunk.size = NumFramesAvailable * 2; chunk.chunk = new int16[chunk.size]; int multiplier = sizeof(int16) / sizeof(unsigned char); std::memcpy(chunk.chunk, Data, chunk.size * multiplier); bool nonZero = false; for (int i = 0; i &lt; chunk.size; i++) { if (chunk.chunk[i] == -1 || chunk.chunk[i] == 1) { chunk.chunk[i] = 0; } if (chunk.chunk[i] != 0) { nonZero = true; UE_LOG(LogTemp, Log, TEXT("NumFramesAvailable: %d, Sample number %d, Sample value %hi"), NumFramesAvailable, i, chunk.chunk[i]); } } if (nonZero) { m_queue.push(chunk); } return 0; } </code></pre> https://dsp.stackexchange.com/q/48253 -1 How to compare two audio files that maybe have been recorded in the same environment Safi https://dsp.stackexchange.com/users/34825 2018-04-01T22:04:13Z 2018-04-02T18:13:09Z <p>I have two audio files that I think they were recorded in the same room. Is there any tool that can be used to compare both of them. Knowing that sample rate and format are the same.</p> <p>Thanks </p> https://dsp.stackexchange.com/q/46849 0 Equation for impulse train Richard Burke-Ward https://dsp.stackexchange.com/users/33613 2018-01-31T10:16:03Z 2018-01-31T12:55:35Z <p>I am looking for a formula (Fourier series) to generate an impulse train waveform - a spike-wave with amplitude and period both $1$ – so that $f(x)$ has value $1$ at $x = 1,2,3,4...$ and $f(x)$ has value $0$ at all non-integer values of $x$.</p> <p>Someone very helpfully gave me:</p> <p>$$S = \frac 1 N \sum_{k=0}^{N-1} e ^{j2\pi\frac{kn}{N}}$$</p> <p>The same equation can be found on this site: <a href="https://dsp.stackexchange.com/questions/35571/equation-for-impulse-train-as-sum-of-complex-exponentials">Equation for impulse train as sum of complex exponentials</a>. However...</p> <p>I have two questions:</p> <ol> <li><p>Is there an equivalent trigonometric function? If so, what is it?</p></li> <li><p>Sadly, my maths A level is such ancient history that I am struggling with what the terms in the above equation mean. Specifically:</p> <ul> <li><p>$S$ = series, i.e. the equivalent of $f(x)$ - yes?</p></li> <li><p>$e$ = famous irrational number - yes?</p></li> <li><p>$j$ = square root of $-1$ - yes?</p></li> <li><p>$N$ and $n$ ... Now, here I get muddled. 30 years of doing no maths at all has left me less than fluent... I assume the lowercase ($n$) is the period/frequency of the impulse train. So that leaves uppercase ($N$) as... The number on the $x$-axis that we are solving for...? The duration of the signal...? Some factor that compensates for $\pi$ to create integer values...?</p></li> </ul></li> </ol> <p>Sorry. I know this is basic stuff. But I'd really appreciate some help...</p> https://dsp.stackexchange.com/q/46598 0 Mathematical equation for the sound wave that a piano makes Murey Tasroc https://dsp.stackexchange.com/users/32701 2018-01-22T00:00:26Z 2018-01-22T04:52:19Z <p>Is there a mathematical function that can output the sound that a piano makes at different frequencies?</p> <p>So if the simplest equation for a sound wave (at a given frequency and for a given sample rate) is</p> <p>$sin(\frac{2 \cdot \pi \cdot x \cdot f}{samplerate})$ </p> <p>where f is frequency, is there a similar equation for the sound that a piano makes?</p> <p>EDIT: I'm not looking for anything too complicated here, just a wave that approximates this estimation. I've been playing around on desmos to see if I can get something similar:</p> <p><a href="https://i.stack.imgur.com/cNPjg.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/cNPjg.png" alt="enter image description here"></a></p> <p><a href="https://drive.google.com/open?id=1ZcUle5W8TJ7xoG9r9E5M1l_XyTOhw88b" rel="nofollow noreferrer">This</a> is what Guest's wave sounds like... not much like a piano.</p> https://dsp.stackexchange.com/q/18621 0 Wav file scale factor Illishar https://dsp.stackexchange.com/users/11362 2014-10-13T09:31:31Z 2017-12-29T12:52:55Z <p>I seek a scaled audio file format for my dsp output.</p> <p>I'd like to produce "scaled wav files", when I've done my pre processing. Eg. if the amplitude is 15.5 (of whatever unit), you should be able to open a standard wav/whatever file and see "15.5". </p> <p>If you produce a normal 16 bit wav file, you have to tell the user, to scale all values with value xx.xx. This would be ok, if the scale factor could be included in the file, in a standardized fashion. But so far I haven't been able to find any "scale factor" field in the wav format?</p> <p>Another way could be to produce a 32 bit float wav file. This could actually contain the value "15.5". Problem is that wav float values are defined to be in the range [ -1.0 : 1.0 ]. I've tried opening such a file in different freewares like eg. Audacity. But they don't take well to the larger scale. They still only display the [ -1.0 : 1.0 ]. Do you know a program that will display large scale float wav files?</p> <p>(Btw I do realize that the "scaled audio" is not "audio" anymore.)</p> https://dsp.stackexchange.com/q/45978 0 Pitch fluctuates unexpectedly in simple sine function Ian Martin https://dsp.stackexchange.com/users/32840 2017-12-23T14:36:50Z 2017-12-24T06:27:47Z <p>I wrote a very basic C program to play a sine of a user-specified frequency. In the interest of portability, I have it spit values directly to stdout, so hopefully you can reproduce my problem on your own machine. This is the code I wrote:</p> <pre><code>#include &lt;math.h&gt; #include &lt;stdio.h&gt; #include &lt;stdlib.h&gt; #include &lt;stdint.h&gt; #define RATE 48000 #define TWOPI (3.14159 * 2.0) int main(int argc, char** argv) { float frequency = atof(argv); float phase = 0.0; float increment = TWOPI/RATE; int16_t sample; while (1) { sample = sin(phase) * 32767; putchar(sample &amp; 255); putchar(sample &gt;&gt; 8); phase += increment * frequency; } return 0; } </code></pre> <p>It can be compiled with:</p> <pre><code>cc sine.c -lm </code></pre> <p>and played with</p> <pre><code>./a.out 440.0 | sox -r 48000 -c 1 -t s16 - -d </code></pre> <p>That is: 16 bit mono audio at a sampling rate of 48,000 Hz.</p> <p>I've tested this on both OpenBSD and MacOS and have noticed the same behavior: at around 6 seconds, the pitch of the wave jumps slightly. This happens again around 12 seconds. Further changes will take place as the wave continues to play. I have also replaced the sin() while loop with a prebuilt wavetable of a sine accessed through linear interpolation, only to notice the same problems.</p> <p>Any ideas what might be off here?</p> https://dsp.stackexchange.com/q/12843 1 Bandpass filter on noisy sinusoid that predicts turning points MisterH https://dsp.stackexchange.com/users/735 2013-11-22T21:57:39Z 2017-12-08T06:36:30Z <p>Is there an application where it is required to predict turning-points of a signal that is like a sinusoid with constant frequency, variable amplitude and some noise (Gaussian additive noise)? The amplitude of the noise should be less than 10% of the amplitude of the original sinusoid every "oscillation".</p> <p>Reason I ask is that I think I found an interesting causal filter for this very specific situation, but I have no imagination for the moment on how it could be usefull.</p> <p>My causal band-pass filter turns earlier than the turning point of the clean sinusoid, so it's like the filter has a negative lag. And the computation time is short, less than my code using FFT (in R: statistics software).</p> <p>I'm a hobiest in DSP so please excuse my ignorance. My knowledge about filters comes mainly from finance (econometrics).</p> <p>To the man with a hammer, the entire world looks like a nail..</p> <p>Thanks for any suggestions.</p> https://dsp.stackexchange.com/q/26341 1 How do you construct common waveforms (square, sawtooth, triangle, noise) from sine wave partials using an IFFT? Aran Mulholland https://dsp.stackexchange.com/users/17724 2015-10-10T08:26:32Z 2017-09-25T07:17:33Z <p>In the lovely image below we see the addition of sine waves making a square wave. I am coding a wave table synthesiser and thought it would be great to get the user to be able to fiddle with the values of the sine partials and then run an inverse FFT on them to produce the wave form.</p> <p><a href="https://i.stack.imgur.com/GfyoT.gif" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/GfyoT.gif" alt="enter image description here"></a></p> <p>I have some code for an FFT and you specify the number of buckets, real and imaginary arrays and the array length. The way it is used in the example is:</p> <ul> <li>Imaginary array has all it's values set to 0</li> <li>The real array has its 0th element set to 0</li> <li>The real array has its arrayLength/2 element set to 0</li> <li>Other values are set in the real array. Every time a value is set in the first half of the array one is set at the opposite end of the array, mirroring whatever is happening in the first half of the real array.</li> <li>This spits out a single cycle of the waveform constructed using these sine partials</li> </ul> <p>What are some common patterns for filling these partials to generate waveforms. How do you generate a square wave, a triangle wave, a sawtooth? Can you create noise or is that impossible if it is non periodic?</p> <p>Extra: What are some tricks for producing 'good' waveforms? This is an opinion question, just a bonus if you have something to share about producing waveforms that sound good. (Good in your opinion :)</p> <p>For those who would find it interesting there is a <a href="http://toxicdump.org/stuff/FourierToy.swf" rel="nofollow noreferrer">flash app here</a> that lets you set the levels of the partials in order to construct waveforms, it's fun.</p> https://dsp.stackexchange.com/q/17714 2 Is it theoretically possible to perfectly quantize a continuous signal? armadadrive https://dsp.stackexchange.com/users/8950 2014-08-12T11:40:20Z 2017-09-04T10:24:50Z <p>So, I'm completely new to digital signal processing, but while reading a piece this morning about quantization it got me daydreaming: could a machine ever be fast enough to sample the position and amplitude of each particle that makes up a wave?</p> https://dsp.stackexchange.com/q/42877 0 wavwrite with 32 bits per sample seems to overflow? sergej https://dsp.stackexchange.com/users/26792 2017-08-02T20:15:05Z 2017-08-02T23:08:42Z <p>I am trying to generate a 32bit PCM wav file with octave, the file shall contain a single full-scale sample (0db impulse). I am getting the expected result when using 24 bits per sample:</p> <pre><code>&gt;&gt; wavwrite(1, 96000, 24, 'foo.wav'); &gt;&gt; wavread('foo.wav') ans = 1.00000 # as expected </code></pre> <p>However, when using 32 bits per sample, the value seems to overflow.</p> <pre><code>&gt;&gt; wavwrite(1, 96000, 32, 'foo.wav'); &gt;&gt; wavread('foo.wav') ans = -1 # WHAT ?! </code></pre> <p>I am expecting the second <code>wavread('foo.wav')</code> to return <code>1</code> not <code>-1</code>. I have checked the wav file with a hex editor, the sample raw value is <code>0x80000000</code>, I am expecting it to be <code>0x7fffffff</code>. Is it an octave bug or am I missing something?</p> <p>Using <code>0.99999</code> instead of <code>1</code> generates the expected result.</p> https://dsp.stackexchange.com/q/42627 1 Is there a special case in which wave atoms convert to curvelets? M.Jalali https://dsp.stackexchange.com/users/18776 2017-07-24T02:03:23Z 2017-07-24T08:44:10Z <p>I'm new to multi scale transformations. I was wondering if there is a special case where wave atom converts to curvelet transform? Can I use wave atom parameters to have curvelet properties?</p> https://dsp.stackexchange.com/q/41455 5 How to triangulate 2 sources on a 2d plane formed by 4 sensors? Blender https://dsp.stackexchange.com/users/28910 2017-06-05T00:43:37Z 2017-06-14T14:54:53Z <p>I have 4 sensors capturing signal data. Signal distribution speed is constant and known. I have sensors positions in 3d space. Also, I have an amplitude/frequency decomposition for data received by each sensor over time (imagine a 3d terrain). Sensors capture signal from 2 moving sources. </p> <p><a href="https://i.stack.imgur.com/pwrfk.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/pwrfk.png" alt="real"></a></p> <p>Here on the image: blue dots are the sensors; red solid Capsules are emmiting objects; transparent red capsules are here to show signal wave propagation pattern; yellow cubes show projections from objects onto a plane formed by sensors; green "points" are desired positions on a plane.</p> <p><strong>Details:</strong></p> <ul> <li>In real life emitters have pill-shaped form emitting in all directions, yet we can assume that they are points emitting spherical waves.</li> </ul> <p><a href="https://i.stack.imgur.com/hxDDs.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/hxDDs.png" alt="enter image description here"></a></p> <ul> <li>In my particular case, we discuss audio waves via air to microphones (but I hoped for a general solution).</li> <li>We do not know the exact signal being transmitted from any of the emitters, yet we do know that there are only two signal sources with not equal positions in space and noise is filtered and extremely low.</li> <li>We can perform any kinds of transformations on top of received signals and we have exact time-data correlation per each sensor.</li> <li>Sensors form a square with side of length $l$</li> </ul> <p>So how to triangulate sources positions on a 2d plane formed by 4 sensors - what is the algorithm?</p> https://dsp.stackexchange.com/q/40991 1 How to "draw" the function/wave to send symbols using QAM? Quantm https://dsp.stackexchange.com/users/28541 2017-05-15T18:18:19Z 2017-05-15T21:58:04Z <p>Say you have the following 8QAM constellation diagram:</p> <p><a href="https://i.stack.imgur.com/WCC1q.gif" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/WCC1q.gif" alt="8QAM constellation diagram"></a></p> <p>Say, you want to send the sequence:</p> <p><strong>001 110 101 000 001</strong></p> <p>How would you draw the function/wave containing the symbols?</p> <p>My problem in understanding this is:</p> <p>I know you use amplitude and phase shifting for defining symbols. Each symbol has a complex function like this:</p> <p>$$g(t) = A \times e^{i(ft + \phi)}$$</p> <p>($A$ = amplitude, $f$ = frequency, $\phi$ = phase)</p> <p>You have one function for each of the possible symbols. But how do you draw the sequence of symbols (or even one symbol)? Isn't $e^{ix} = \mathrm{cos}(x) + i \times \mathrm{sin}(x)$ ? Do I draw the real part or the imaginary part?</p> <p>Thanks!</p> https://dsp.stackexchange.com/q/34098 0 How to mix two audio files recorded with different settings to obtain a realistic result sämi https://dsp.stackexchange.com/users/23591 2016-09-05T08:36:59Z 2017-04-05T07:20:44Z <p>I am a software engineer, currently working on a signal-processing related project, which I am new to. For evaluating the algorithm(which is written in R), I need to mix (merge) two different audio signals synthetically. The question is how to mix these two signals and obtain a “realistic” result?</p> <p>To be more specific, consider the following scenario:</p> <ol> <li><p>I have recorded Signal_A, and downloaded signal_B from the internet (therefore two different microphones/settings are used for recording).</p></li> <li><p>The sound pressure level of both signals are known( I measured the sound pressure level of Signal_A in 1m distance, and also know the sound pressure level of Signal_B in the same distance).</p></li> <li><p>As far as I know, the value recorded/represented in each waveform of any signal is relative to that corresponding signal, and since two signals are recorded using different settings we can expect that one might be more amplified than the other. Therefore a simple mixing of the two won’t give us a realistic result.</p></li> </ol> <p>Now the question is: is there a way to manipulate recorded signal_A and signal_B programatically, assuming the fact that the SPL values of the original signals at 1m distance is known, and get the merged signal as they were playing simultaneously and recorded at 1m distance? i.e. to calculate factor ‘a’ and ‘b’ in a way that the realistic merged signal is formulated by:</p> <pre><code>Mereged_Signal = a*Signal_A + b*Signal_B </code></pre> <p>Thanks in advance!</p> https://dsp.stackexchange.com/q/13335 2 How to obtain the Sound Pressure Level from .wav file based on these given parameters? Ken Tsui https://dsp.stackexchange.com/users/7356 2013-12-23T16:29:19Z 2017-03-21T14:38:02Z <p>I have a wav file recorded from a hydrophone. I am not quite familiar with signal processing so I really need some advice from you.</p> <p>I have gathered the information which looks useful and related.</p> <p>sample rate = 250 000 Hz</p> <p>Receive sensitivity of hydrophone = -180 db re 1V/μ Pa</p> <p>Peak-to-peak voltage range = 5.64 V</p> <p>Pre-amplifier gain = <strong>18 dB</strong> (Modified)</p> <p>Let A be the amplitude saved in the wav file. What is the formula to transform A from amplitude to Sound Pressure Level?</p> <p>If the given information is not sufficient, please tell me what more do I need?</p> <p>Any helps are appreciated!</p> https://dsp.stackexchange.com/q/37861 0 In DSP - is it true that the only type of interfering wave occurs when frequencies match? [closed] Rain https://dsp.stackexchange.com/users/26546 2017-02-23T13:25:15Z 2017-02-23T16:21:54Z <p>Therefore, any other frequency, no matter the amplitude, won't interfere or degrade original wave in the DSP frequency domain systems?</p>