electro-music.com   Dedicated to experimental electro-acoustic
and electronic music
 
    Front Page  |  Radio
 |  Media  |  Forum  |  Wiki  |  Links
Forum with support of Syndicator RSS
 FAQFAQ   CalendarCalendar   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   LinksLinks
 RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in  Chat RoomChat Room 
 Forum index » DIY Hardware and Software » ChucK programming language
Extreme level peak from SqrOsc oscillator
Post new topic   Reply to topic Moderators: Kassen
Page 1 of 1 [10 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
Author Message
ullyssen



Joined: Sep 22, 2017
Posts: 4
Location: everywhere

PostPosted: Fri Sep 22, 2017 4:57 am    Post subject: Extreme level peak from SqrOsc oscillator Reply with quote  Mark this post and the followings unread

Hi!

I need some strange artifact to be removed from ChucK output.

I created the following code: simple function to control square oscillator:

Code:

fun void sqrG(int tone, int time, int silence)
  {
    SqrOsc o => ADSR e => dac;
    tone => o.freq;
    e.set(0::samp,2::samp,0.5,1::samp);      
    e.keyOn();
    time::ms => now;
    e.keyOff();
    silence::ms => now;
  }


Every time this function is executed, resulting square signal contains extreme level peak right at the beginning, as shown on this screenshot from Audition editor:

Posted Image, might have been reduced in size. Click Image to view fullscreen.

Interesting is that all other oscillator types (SinOsc, TriOsc, SawOsc) don't produce this artifact.
Back to top
View user's profile Send private message
gabbagabi



Joined: Nov 29, 2008
Posts: 651
Location: Berlin by n8
Audio files: 23

PostPosted: Fri Sep 22, 2017 8:17 am    Post subject: Reply with quote  Mark this post and the followings unread

hi,
what ur using to measure?
may a soundcard oszilloskope?
if so soundcards often have caps on there inputs that could provoke this behaviour on square waves.
Back to top
View user's profile Send private message
ullyssen



Joined: Sep 22, 2017
Posts: 4
Location: everywhere

PostPosted: Fri Sep 22, 2017 9:13 am    Post subject: Reply with quote  Mark this post and the followings unread

g.gabba wrote:
hi,
what ur using to measure?
may a soundcard oszilloskope?
if so soundcards often have caps on there inputs that could provoke this behaviour on square waves.


No, output was directly recorded to WAV file and analysed in Audtion CS6 editor.
Back to top
View user's profile Send private message
blue hell
Site Admin


Joined: Apr 03, 2004
Posts: 24079
Location: The Netherlands, Enschede
Audio files: 278
G2 patch files: 320

PostPosted: Fri Sep 22, 2017 9:20 am    Post subject: Reply with quote  Mark this post and the followings unread

It looks like the anti-aliasing behaves a bit strange directly after initialization ... it might be easiest to apply some startup envelope to mask the effect ...
_________________
Jan
also .. could someone please turn down the thermostat a bit.
Posted Image, might have been reduced in size. Click Image to view fullscreen.
Back to top
View user's profile Send private message Visit poster's website
ullyssen



Joined: Sep 22, 2017
Posts: 4
Location: everywhere

PostPosted: Fri Sep 22, 2017 9:54 am    Post subject: Reply with quote  Mark this post and the followings unread

Blue Hell wrote:
It looks like the anti-aliasing behaves a bit strange directly after initialization ... it might be easiest to apply some startup envelope to mask the effect ...


Could you provide me with some code example?
Back to top
View user's profile Send private message
blue hell
Site Admin


Joined: Apr 03, 2004
Posts: 24079
Location: The Netherlands, Enschede
Audio files: 278
G2 patch files: 320

PostPosted: Fri Sep 22, 2017 9:59 am    Post subject: Reply with quote  Mark this post and the followings unread

Sorry, I'm not able to do so ... but I could interpret your image Laughing

Maybe Antimon can come up with something? (when he is not too busy preparing for two shows to run ...)

_________________
Jan
also .. could someone please turn down the thermostat a bit.
Posted Image, might have been reduced in size. Click Image to view fullscreen.
Back to top
View user's profile Send private message Visit poster's website
ullyssen



Joined: Sep 22, 2017
Posts: 4
Location: everywhere

PostPosted: Fri Sep 22, 2017 1:09 pm    Post subject: Reply with quote  Mark this post and the followings unread

I've changed the code, so

Code:
SqrOsc o => ADSR e => dac;


became


Code:
SqrOsc o => Dyno limiter1 => ADSR e => Dyno limiter2 => dac;


and then I've activated both limiter instances.
Yet this peak still emerges.
Back to top
View user's profile Send private message
Grumble



Joined: Nov 23, 2015
Posts: 1294
Location: Netherlands
Audio files: 30

PostPosted: Mon Sep 25, 2017 3:09 am    Post subject: Reply with quote  Mark this post and the followings unread

What strikes me as strange is that ringing occurs BEFORE a step of the signal as well as AFTER the step.
Shocked

_________________
my synth
Back to top
View user's profile Send private message Visit poster's website
blue hell
Site Admin


Joined: Apr 03, 2004
Posts: 24079
Location: The Netherlands, Enschede
Audio files: 278
G2 patch files: 320

PostPosted: Mon Sep 25, 2017 5:15 am    Post subject: Reply with quote  Mark this post and the followings unread

Heh, ringing before means that it is not ringing but bandlimiting instead being in effect.
_________________
Jan
also .. could someone please turn down the thermostat a bit.
Posted Image, might have been reduced in size. Click Image to view fullscreen.
Back to top
View user's profile Send private message Visit poster's website
blue hell
Site Admin


Joined: Apr 03, 2004
Posts: 24079
Location: The Netherlands, Enschede
Audio files: 278
G2 patch files: 320

PostPosted: Mon Sep 25, 2017 5:17 am    Post subject: Reply with quote  Mark this post and the followings unread

You can think of it being a square wave approximated by sines.
_________________
Jan
also .. could someone please turn down the thermostat a bit.
Posted Image, might have been reduced in size. Click Image to view fullscreen.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic Moderators: Kassen
Page 1 of 1 [10 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
 Forum index » DIY Hardware and Software » ChucK programming language
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Forum with support of Syndicator RSS
Powered by phpBB © 2001, 2005 phpBB Group
Copyright © 2003 through 2009 by electro-music.com - Conditions Of Use