views:

31

answers:

2

hello i want to create a SoundEditro with a wave form. i want to show all samples in this wave form but samples count > 9000000 thus my program work very bad. please help me, for create a waveform that show all samples rapidly.

i use from MSChart for Framework 3.5 sp1

A: 

If you allow one pixel per sample along the time axis then you re going to need a display with 9x10^6 pixels on one of its dimensions. Failing that, you have either to downsample to within the capabilities of your display, or implement a sliding window so that you can look at part of the waveform.

If your program is performing poorly that might be an indication that downsampling is the way to go.

High Performance Mark
And in Audio jargon, downsampling would be a low-pass filter.
Henk Holterman
i used from a chart so i am not limit for display width.
Majid Hazari
it is mean that i can show all sample but my problem is here that if i dont show all sample user cant edit wave with details, now if i can show all sample my program work bad.
Majid Hazari
i want to user zoom to waveform and see samples.
Majid Hazari
+1  A: 

You have to approach this from the other side: you have an upper limit for the amount of detail determined by the user+screen.

So think in terms of: What data do I have (let's say 10.000.000) and what can I show (1000 pixels wide). You then you have to simplify 1:1000. Better determine a formula for that, don't leave it to rounding by a graphics engine.

When you add a Zoom option the ratio changes.

Henk Holterman
Of course, zoom also causes clipping, which also reduces the number of samples that have to be plotted at once.
Ben Voigt
i used from a chart so i am not limit for display width.it is mean that i can show all sample but my problem is here that if i dont show all sample user cant edit wave with details, now if i can show all sample my program work bad. i want to user zoom to waveform and see samples.
Majid Hazari
@Majid: I think you want to show the whole length. But not all samples (all the time). You need a (downsample) filter.
Henk Holterman