some advice for a DSP newbie please

hi i am new to dsp but i have made a simple program so far.Eventually i want to turn it into something bigger,but for now i would like to make sure i got it working correct.First off let me post a pic.
http://img829.imageshack.us/img829/2990/dsptest.jpg

alright now that you can see my programs output i was wondering if someone who know more about this area should be able to tell me if this seems about right,
what im most curious about is why does the frequency keep going up? i mean if i add more points to my transform it would just keep getting higher. I thought that when i cout the frequency array it would show the frequency of that current sample.but like i said im not really familiar with this.

for all those tldr people, I want to know if these values seem right? and why does the frequency just go up each time and not change per sample?


also please dont suggest BASS or fmod or any other lib i want to do it myself with no sound lib's.I know it would be alot easier to use fmod getspectrum() or something like that.but i think you get more knowledge out of it when you make your own instead of using premade libs for things.
I can't claim to be a DSP expert but I rather suspect that to answer those questions people are going to need to know what you are trying to achieve. And the code that you are trying to achieve it with.
eventually i want to be able to add visualizations to my media player.something like this

█ █
█ █
█ █ █
█ █ █
██ ███ █ █
██ ███ █ █
██████████

and like this

/ \ /
/ \ /
/ \/

where the bars go up and down dependant on the music.


but for now i am just trying to get it working so i can get the data from the samples so i can plot them.I posted here to see if someone who is more adept at sound and dsp could see if those values my program output are correct.
add visualizations to my media

A graphic mode is required. The monitor won't report it before such a plunge.
huh? im not worried of graphics. i want to know about the questions i asked about the data.once i get that sorted graphics are no problem for me.
Maybe i can help.

With analog to digital conversion your sound sampled with some frequency (e.g. 44khz) and resolution (e.g. 128bit).
Every sampling time you get signal value (magnitude or amplitude). This values sequentially written in sound file. You can see it in .wav file after file header and in .raw file without header.
With digital to analog conversion you set values from file to output with same frequency as sampled before.

Waves (/\/\/) it is graphically represented values. x-coordinate is time, y-coordinate - signal value.
Peaks (█ █) it is graphically represented signal spectrum. x-coordinate is frequency, y-coordinate is spectral value. You can get spectral values with fourier transform of time values.

I can't explain your frequency deviation. Momentary frequency value is nonsense in my opinion. How you get it?
Ok its hard to explain what i mean.ill try again you see the pic off my output,what should the magnitude of each sample be between (is there a certain range it should be in?) and should there be negative values?
This morning i think i understand what does you program =)
It is spectral analyser. Output is gain-frequency variation and phase-frequency variation.
With this data you can draw a peaks. Use frequency as x-coordinate, magnitude as y-coordinate.
But this gain-frequency variation graphic of a whole sound. If you want get momentary variation like in media players, you need to calculate gain-frequency variation on several samples every time.
With this data you can't get waves.

(is there a certain range it should be in?) and should there be negative values?

I can't answer on this questions. Mathematically it can be negative and can take any value (moreover it can be negative frequency values!). In your program seems to be only positive. Sample magnitude always scaled and it is difficult to estimate ranges.
Topic archived. No new replies allowed.