Re: Best drawing technology for audio waveforms, envelopes, etc.?
Re: Best drawing technology for audio waveforms, envelopes, etc.?
- Subject: Re: Best drawing technology for audio waveforms, envelopes, etc.?
- From: Alastair Houghton <email@hidden>
- Date: Sun, 24 Jun 2007 08:42:29 +0100
On 24 Jun 2007, at 01:11, Steve Israelson wrote:
BTW, please remember not to make the classic mistake when drawing
audio waveforms, which is to assume that you can zoom out by
simply drawing every Nth point. To zoom out without drawing every
point, at a minimum you must find the minimum and maximum sample
values at each horizontal co-ordinate. I'm sure you wouldn't make
this mistake, but it's so common that I thought I'd mention it here.
No this is incorrect.
No, it isn't.
You must find the average energy in the group of audio samples that
represent one pixel wide in the x-coord.
The min and max is not good enough.
The min and max is, as I said, the *minimum* that you must do in
order to avoid distorting the waveform. It is not the best solution,
but it is the simplest *acceptable* solution. Picking any single
value is always incorrect, because it will lead to distortions of the
visible waveform on screen.
QSSP takes a further approach and finds the power average of 4
groups of the samples and then blends them together when it renders
one vertical slice so you can see clearly where most of the audio
energy is.
I didn't say that you couldn't use a more sophisticated approach,
just that minimaxing is the absolute minimum that will work.
Clearly, shading the vertical span to indicate the proportion of
samples that fall within a particular region is better than simple
minimaxing; whether the shading is done so that it is proportional to
signal power or signal amplitude is really a matter of taste as much
as anything, though on a linear plot of sample values it would make
more sense to use amplitude.
Anyway, this is heading wildly off topic.
Kind regards,
Alastair.
--
http://alastairs-place.net
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden