Csound Csound-dev Csound-tekno Search About

[Csnd] Issues with dcblock, dcblock2

Date2022-08-25 14:39
FromSteven Yi
Subject[Csnd] Issues with dcblock, dcblock2
Attachmentsimage.png  image.png  image.png  image.png  vco2_D0.csd  
Hi All,

I'm trying to figure out some oddities with dcblock and dcblock2. I'm using a vco2 sawtooth tuned to D0 and I see:

* With dcblock, it seems to introduce DC
* With dcblock2, it rolls off the low end

I've pasted screenshots below of time domain and spectral plots from Audacity. I've also attached my test CSD to this email. Is there something I'm missing? 

Thanks!
Steven



Time Domain
image.png

Plain VCO2:

image.png

dcblock
image.png

dcblock2
image.png
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2022-08-25 14:53
FromSteven Yi
SubjectRe: [Csnd] Issues with dcblock, dcblock2
Attachmentsimage.png  image.png  image.png  image.png  
Following up, I should have looked around for some info about frequency response of DC blockers:

https://www.dsprelated.com/freebooks/filters/DC_Blocker.html

That said, dcblock2's low end response seems very steep compared to dcblock. I'm not really sure what happened with dcblock for it to cause DC either. 

On Thu, Aug 25, 2022 at 9:39 AM Steven Yi <stevenyi@gmail.com> wrote:
Hi All,

I'm trying to figure out some oddities with dcblock and dcblock2. I'm using a vco2 sawtooth tuned to D0 and I see:

* With dcblock, it seems to introduce DC
* With dcblock2, it rolls off the low end

I've pasted screenshots below of time domain and spectral plots from Audacity. I've also attached my test CSD to this email. Is there something I'm missing? 

Thanks!
Steven



Time Domain
image.png

Plain VCO2:

image.png

dcblock
image.png

dcblock2
image.png
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2022-08-25 19:08
FromST Music
SubjectRe: [Csnd] Issues with dcblock, dcblock2
Attachmentsimage.png  image.png  image.png  image.png  20220825_135053.png  Screenshot_20220825-131138.jpg  
A few notes, not that this resolves anything. As can be seen in the attachments, the DC blocks are literally And dramatically altering waveshapes. Whether this would be the case with far more complex waveforms as opposed to simple ones I don't know, it perhaps warrants investigating.

Note I attached 2 images.

The middle saw wave example does not in fact appear to have a DC offset, to me it looks as it should for a saw wave that has a convex tail so to speak. I've seen this before from waveform generators. I cropped the middle rendered section and there is no reported DC offset (I checked in two editors and got the same).

By appearances, the section of the saw wave marked A would probably have the same area as B - they have different offsets from 0 but also substantially different widths. I can't mathematically prove this so just taking a guess.

The image of the square waves which I rendered would possibly to support the idea that DC is not being introduced. 

In the end, as it stands, it seems that using the DC block becomes more of an issue of practical necessity and not so much as a safety net so to speak as it seems to have it's own side effects.

I know my reply isn't particularly helpful but wanted to point out a few things I noticed, apologies if they seem redundant.

As an aside, I had to laugh when I saw the third rendered square wave as it closely resembles a well known shape that wave folders produce referred to as The Batman shape.

I actually did a little video recently that shows this:

On Thu, Aug 25, 2022, 9:40 AM Steven Yi, <stevenyi@gmail.com> wrote:
Hi All,

I'm trying to figure out some oddities with dcblock and dcblock2. I'm using a vco2 sawtooth tuned to D0 and I see:

* With dcblock, it seems to introduce DC
* With dcblock2, it rolls off the low end

I've pasted screenshots below of time domain and spectral plots from Audacity. I've also attached my test CSD to this email. Is there something I'm missing? 

Thanks!
Steven



Time Domain
image.png

Plain VCO2:

image.png

dcblock
image.png

dcblock2
image.png
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here