Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: L / R Frequency Analysis (Read 5371 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

L / R Frequency Analysis

Can someone quide me how to output the difference between left and right channel frequency?

Thanks

L / R Frequency Analysis

Reply #1
I think you need to describe you requirements better.

In general there is no single frequency in a musical sample, so do you want a spectrogram (two-channel L and R or showing the spectrum of the 'difference channel' (S in Mid-Side stereo)) or a FFT spectral analysis at a certain point in time, with, say, a red graph and a blue graph for left and right?
Dynamic – the artist formerly known as DickD

L / R Frequency Analysis

Reply #2
I think that Richard Horne's "Spectrogram" has this capability.
Ceterum censeo, there should be an "%is_stop_after_current%".

L / R Frequency Analysis

Reply #3
@ pawelq: thanks, i'll try that tool

@ Dynamic: i want to output the L/R freq. differences in the range < 1kHz over time in readable numbers. i tray with cool edit pro which is great, but the output result (ascii numbers) is freq/amplitude and not freq/time. i made for ex. 2 pure simple sqare waves which differ in 10Hz (440 - 450Hz) but i can't get any output, although it's simplified example. maybe i should try matlab or octave, but i'm not too familliar with audio analysis with both programs.

L / R Frequency Analysis

Reply #4
I don't have the answers, but there are a couple of considerations before you start looking for a solution....

First, it makes a difference if you are working with simple single-frequency waveforms or complex multi-frequency waveforms like voice or music.  Spectrograms and frequency analyzers are used to analyze complex waveforms.    The mathematical calculations for this are complex (requiring FFT), and the frequency measurement is made in frequency-bands.  For example, you might be able to measure the energy content in the 400 - 500Hz band, but you might not be able to measure the difference between 440 and 450 Hz.

The frequency of single-frequency waveforms (like your square waves) can be precicely measured or calculated.  And, the calculations are simple.  It would be a simple matter for a programmer to write a program to calculate the frequency for these simple waves (assuming the programmer knows something about audio programming).


Second, it makes a difference if you are analyzing real-time sound, or audio data from a file.  I've never used Matlab or Octave, but I assume they typcially need data from a file.  And, I don't know if either of thse programs can directly read a WAV file (I think so), or if the data has to be (somehow) extracted first. 

You can measure real-time single-frequency waveforms with an instrument called a frequency counter.  For that situation, a couple of frequency counters hooked-up to chart recorders or data-loggers would give you the data you're looking for.  (But, this is expensive lab equipment).  I know of one freeware Frequency Counter Program[/u], but It's too limited for what you are doing...  It's single-channel, and it doesn't record the data.

L / R Frequency Analysis

Reply #5
@ Dynamic: i want to output the L/R freq. differences in the range < 1kHz over time in readable numbers. i tray with cool edit pro which is great, but the output result (ascii numbers) is freq/amplitude and not freq/time. i made for ex. 2 pure simple sqare waves which differ in 10Hz (440 - 450Hz) but i can't get any output, although it's simplified example. maybe i should try matlab or octave, but i'm not too familliar with audio analysis with both programs.


It sounds like you don't want a spectrogram (I was thinking of plotting the Mean-Squared Difference frequency in the old fb2k spectrogram visualisation), but to make measurements of some frequencies (not so much from music, but other signals at audio frequencies).

A square wave is far from simple in conventional terms, where one looks to find sinusoidal waves in the frequency domain as component parts. The 440 Hz square wave is composed of a 440 Hz sine, the third harmonic (1320 Hz sine at 1/3 the amplitude), the fifth harmonic (2200 Hz sine at 1/5 the amplitude), the 7th harm (3080 Hz at 1/7 the amplitude), etc...

So the difference between the 440 Hz square wave in channel 1, and the 450 Hz square wave in channel 2, is 10 Hz for the fundamental sine component, 30 Hz for the third harmonics, 50 Hz for the 5th harmonic, etc. Furthermore, you could find the difference between the 1320 Hz and 450 Hz and report that (870 Hz).

OK, you wanted less than 1 kHz, but then what about a 110 Hz square wave and its harmonics?

You might simply look for the largest peak in each channel, which is hopefully the fundamental.

The other problem is time versus frequency resolution. A long Fourier Transform window is required to obtain high resolution of frequency, which limits the number of independent time intervals and hence the time resolution.

If you signal is simple enough, you may be able to remove any DC offset and look at zero crossings to measure frequency. In electronics, a Phase Lock Loop (PLL) can be used to generate a clock frequency (square wave) synchronised to clock edges in the signal. It might be possible to obtain a lock to the dominant frequency in similar fashion.
Dynamic – the artist formerly known as DickD

L / R Frequency Analysis

Reply #6
first of all thank you for sharing your knowledge, and i think i miss some fundamentals in this area (but who knows everything|).
in reality i'm trying to find brainwave patterns in some cable tel documentaries:? where only < 1KHz are extracted (for obvious reason)
@ pawelq spectrogram is much better then those of CEP or SForge, at least i can identify the bands where this differences occure. thanks
@ DVDdoug - i'll try with octave (reads WAV among the others) with their Signal Processing (FFT) Tools and Audio Processing (to read the data:). And about Frequency Counter Program you said it: It's single-channel, and it doesn't record the data (or if you rec the window to avi and read the freq frame by frame?!)
@ Dynamic - yes, sin wave is the simplest ex. i don't know that about sqare waves, thanks, so the demo ex. should be sin. nevertheless the particular sounds that i suppose to find and actually sin waves and their derivates. quote: "A long Fourier Transform window is required to obtain high resolution of frequency, which limits the number of independent time intervals and hence the time resolution." - yes it's true. i don't understand you're last sentence (unfortunately:(
if i'm not faced with something bigger than me, any results will be posted here.
thank you again

L / R Frequency Analysis

Reply #7
ok, i've decided to switch to matlab, just don't want right now to reinvent the wheel, so this is the hit: EEGLAB toolbox (although octave can do it, but it's easier this way)

it's not so straitforward but i don't need to recreate functions and there are more to learn from it.

i'll play with it one of these days, sueing the cab tel channel about not informing their viewers about deliberate and dangerous influence of those patterns to some people. and the founds of course - antarctic meteorology station:)

the first target UN OBN channel

results - sooner that i expected