Dear Pd friends,
can you help me to understand [wrap~] better? My purpose is to create a
"video raster" (using audio signals at a high sample rate) of X and Y
values to read luma information from [pix_data].
To do this, I have one [phasor~] creating the vertical ramp, at 25 Hz (=
25 frames per second).
Then I require another series of ramps from 0 to 1 for the horizontal
lines. If I want 120 lines per frame, I do it like this:
[phasor~ 25]
|
[*~ 120]
|
[wrap~]
This gives me 120 ramps for every one cycle of [phasor~]. So far so good.
However, the ramps I get are not equal in amplitude, there are tiny
variations which cause distortions in the raster, and which I can see
when I plot the ramps to a array with [tabwrite~], and which I can see
as a jagged edge if I plot my raster out on an XY oscilloscope or similar.
Also, the ramps have some phase issues. 25 frames with 120 lines per
frame works just fine, but as I adjust the frame rate or the number of
lines per frame, the image data which I get from [pix_data] seems to
"rotate" out of the frame and wrap around to the other side. Only
multiples of 25/120 give me image date which is centered in the frame of
the video or image being analyzed by [pix_data].
I would be happy to make a video of this if you like, but I wonder if
someone with better DSP knowledge than me might have some suggestions.
You can see the patch in question here:
https://github.com/macumbista/vectorsynthesis/blob/master/V-scanprocessor-help.pd
(Requires checking out entire Vector Synthesis library. Also requires PD
>= 0.47 and Gem if you want all of it to work. Open the
[V-scanprocessor] object to see the [phasor~] and [wrap~] configuration.)
Andy Farnell suggested that the amplitude differences in the ramps may
be a cumulative 32 bit precision error, but that would not explain the
phase issue. I also tried using sample-rate [metro] and [line~] objects
to create the horizontal lines but this was even less precise.
Thank you for your kind attention!
Derek
--
derek holzer
noise.art.technology
http://macumbista.net
_______________________________________________
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management ->
https://lists.puredata.info/listinfo/pd-list