Csound Csound-dev Csound-tekno Search About

Highpass effect of DC block filter

Date2016-06-17 09:19
FromAndreas Bergsland
SubjectHighpass effect of DC block filter
Attachmentsdcblock_test.csd  andreas_bergsland.vcf  
Hi,
Modelled after some of Iain's instruments, I've put in DC blocking in 
the feedback loop to prevent it from building up.
But I've observed that the dcblock filters in csound (dcblock, dcblock2) 
have an high-pass filtering effect (as demonstrated in the attached 
csd), which naturally gets emphasized when the filter is a part of a 
feedback loop.
Is the high-pass effect an inevitable result of DC blocking filters?
Or is it possible to have some kind of DC block without high pass effect?
Or could an alternative solution be to test the signal average over a 
certain window, and then only apply DC block filtering when the average 
crosses a some (positive or negative) threshold that indicates an 
"unhealthy" DC offset?
Best,
Andreas

-- 
Andreas Bergsland,
førsteamanuensis

Musikkteknologiseksjonen
Institutt for musikk
Olavskvartalet
NTNU
7491 Trondheim

Besøksadresse: Fjordgt.1 (3.etg.)
e-post: andreas.bergsland@ntnu.no
Web: http://folk.ntnu.no/andbe
Tlf: 7359 0096
Mob: 4566 3316


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

Date2016-06-17 10:16
FromVictor Lazzarini
SubjectRe: Highpass effect of DC block filter
dcblockers are, by definition highpass filters. Not sure whether they should be placed inside the feedback path, unless there is a specific effect you want to achieve besides dc blocking. Usually, for that purpose they are placed at the output.

Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy
Maynooth University
Ireland

> On 17 Jun 2016, at 09:19, Andreas Bergsland  wrote:
> 
> Hi,
> Modelled after some of Iain's instruments, I've put in DC blocking in the feedback loop to prevent it from building up.
> But I've observed that the dcblock filters in csound (dcblock, dcblock2) have an high-pass filtering effect (as demonstrated in the attached csd), which naturally gets emphasized when the filter is a part of a feedback loop.
> Is the high-pass effect an inevitable result of DC blocking filters?
> Or is it possible to have some kind of DC block without high pass effect?
> Or could an alternative solution be to test the signal average over a certain window, and then only apply DC block filtering when the average crosses a some (positive or negative) threshold that indicates an "unhealthy" DC offset?
> Best,
> Andreas
> 
> -- 
> Andreas Bergsland,
> førsteamanuensis
> 
> Musikkteknologiseksjonen
> Institutt for musikk
> Olavskvartalet
> NTNU
> 7491 Trondheim
> 
> Besøksadresse: Fjordgt.1 (3.etg.)
> e-post: andreas.bergsland@ntnu.no
> Web: http://folk.ntnu.no/andbe
> Tlf: 7359 0096
> Mob: 4566 3316
> 
> 
> 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

Date2016-06-17 11:01
FromAndreas Bergsland
SubjectRe: Highpass effect of DC block filter
Attachmentsandreas_bergsland.vcf  
Thanks for clearing that up. Probably better to leave it out of the 
feedbackloop, then.
Andreas
> dcblockers are, by definition highpass filters. Not sure whether they should be placed inside the feedback path, unless there is a specific effect you want to achieve besides dc blocking. Usually, for that purpose they are placed at the output.
>
> Victor Lazzarini
> Dean of Arts, Celtic Studies, and Philosophy
> Maynooth University
> Ireland
>
>> On 17 Jun 2016, at 09:19, Andreas Bergsland  wrote:
>>
>> Hi,
>> Modelled after some of Iain's instruments, I've put in DC blocking in the feedback loop to prevent it from building up.
>> But I've observed that the dcblock filters in csound (dcblock, dcblock2) have an high-pass filtering effect (as demonstrated in the attached csd), which naturally gets emphasized when the filter is a part of a feedback loop.
>> Is the high-pass effect an inevitable result of DC blocking filters?
>> Or is it possible to have some kind of DC block without high pass effect?
>> Or could an alternative solution be to test the signal average over a certain window, and then only apply DC block filtering when the average crosses a some (positive or negative) threshold that indicates an "unhealthy" DC offset?
>> Best,
>> Andreas
>>
>> -- 
>> Andreas Bergsland,
>> førsteamanuensis
>>
>> Musikkteknologiseksjonen
>> Institutt for musikk
>> Olavskvartalet
>> NTNU
>> 7491 Trondheim
>>
>> Besøksadresse: Fjordgt.1 (3.etg.)
>> e-post: andreas.bergsland@ntnu.no
>> Web: http://folk.ntnu.no/andbe
>> Tlf: 7359 0096
>> Mob: 4566 3316
>>
>>
>> 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


-- 
Andreas Bergsland,
førsteamanuensis

Musikkteknologiseksjonen
Institutt for musikk
Olavskvartalet
NTNU
7491 Trondheim

Besøksadresse: Fjordgt.1 (3.etg.)
e-post: andreas.bergsland@ntnu.no
Web: http://folk.ntnu.no/andbe
Tlf: 7359 0096
Mob: 4566 3316


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

Date2016-06-17 11:50
FromOeyvind Brandtsegg
SubjectRe: Highpass effect of DC block filter
Actually, no. As I know you might want to do granular processing in
the feedback loop... certain combinations of source wave frequency and
grain size may produce a grain that has positive-only contents, this
will quickly build up an unhealthy DC offset if you don't do DC
filtering in the feedback loop.

BUT, it looks like dcblock2 may be behaving a little bit odd in that
it removes more low frequency components than what I'd expect.
I thought dcblock2 should act like a hipass filter with a cutoff at ca
5Hz, but running white noise through it shows that the frequency
response is (somewhat) similar to a butterhp with cutoff at around
100Hz (rough estimate). The two filters will naturally work a bit
differently, but it sounds and looks roughly similar (ddcblock and a
100Hz butterhp).
Like this:
instr 1
a1 rnd31 0.5,1
adcb dcblock2 a1
ahp butterhp a1, 100
outs adcb, ahp
endin


Andreas, you could replace dcblock in your code by applying butterhp
with a cutoff of around 5Hz, like this
afeed = butterhp(abuzz + adel * 0.99, 5)
This should allow all the good bass through even within a feedback.
You can even go much lower with the cutoff: 0.1Hz will also work, it
will just remove the DC a bit more slowly.

Oeyvind


2016-06-17 12:01 GMT+02:00 Andreas Bergsland :
> Thanks for clearing that up. Probably better to leave it out of the
> feedbackloop, then.
> Andreas
>
>> dcblockers are, by definition highpass filters. Not sure whether they
>> should be placed inside the feedback path, unless there is a specific effect
>> you want to achieve besides dc blocking. Usually, for that purpose they are
>> placed at the output.
>>
>> Victor Lazzarini
>> Dean of Arts, Celtic Studies, and Philosophy
>> Maynooth University
>> Ireland
>>
>>> On 17 Jun 2016, at 09:19, Andreas Bergsland 
>>> wrote:
>>>
>>> Hi,
>>> Modelled after some of Iain's instruments, I've put in DC blocking in the
>>> feedback loop to prevent it from building up.
>>> But I've observed that the dcblock filters in csound (dcblock, dcblock2)
>>> have an high-pass filtering effect (as demonstrated in the attached csd),
>>> which naturally gets emphasized when the filter is a part of a feedback
>>> loop.
>>> Is the high-pass effect an inevitable result of DC blocking filters?
>>> Or is it possible to have some kind of DC block without high pass effect?
>>> Or could an alternative solution be to test the signal average over a
>>> certain window, and then only apply DC block filtering when the average
>>> crosses a some (positive or negative) threshold that indicates an
>>> "unhealthy" DC offset?
>>> Best,
>>> Andreas
>>>
>>> --
>>> Andreas Bergsland,
>>> førsteamanuensis
>>>
>>> Musikkteknologiseksjonen
>>> Institutt for musikk
>>> Olavskvartalet
>>> NTNU
>>> 7491 Trondheim
>>>
>>> Besøksadresse: Fjordgt.1 (3.etg.)
>>> e-post: andreas.bergsland@ntnu.no
>>> Web: http://folk.ntnu.no/andbe
>>> Tlf: 7359 0096
>>> Mob: 4566 3316
>>>
>>>
>>> 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
>
>
>
> --
> Andreas Bergsland,
> førsteamanuensis
>
> Musikkteknologiseksjonen
> Institutt for musikk
> Olavskvartalet
> NTNU
> 7491 Trondheim
>
> Besøksadresse: Fjordgt.1 (3.etg.)
> e-post: andreas.bergsland@ntnu.no
> Web: http://folk.ntnu.no/andbe
> Tlf: 7359 0096
> Mob: 4566 3316
>
>
> 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



-- 

Oeyvind Brandtsegg
Professor of Music Technology
NTNU
7491 Trondheim
Norway
Cell: +47 92 203 205

http://www.partikkelaudio.com/
http://soundcloud.com/brandtsegg
http://flyndresang.no/
http://soundcloud.com/t-emp

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

Date2016-06-17 11:58
FromAndreas Bergsland
SubjectRe: Highpass effect of DC block filter
Attachmentsandreas_bergsland.vcf  
Thanks Oeyvind, that was very useful. I will try with butterhp, then.
Andreas
> Actually, no. As I know you might want to do granular processing in
> the feedback loop... certain combinations of source wave frequency and
> grain size may produce a grain that has positive-only contents, this
> will quickly build up an unhealthy DC offset if you don't do DC
> filtering in the feedback loop.
>
> BUT, it looks like dcblock2 may be behaving a little bit odd in that
> it removes more low frequency components than what I'd expect.
> I thought dcblock2 should act like a hipass filter with a cutoff at ca
> 5Hz, but running white noise through it shows that the frequency
> response is (somewhat) similar to a butterhp with cutoff at around
> 100Hz (rough estimate). The two filters will naturally work a bit
> differently, but it sounds and looks roughly similar (ddcblock and a
> 100Hz butterhp).
> Like this:
> instr 1
> a1 rnd31 0.5,1
> adcb dcblock2 a1
> ahp butterhp a1, 100
> outs adcb, ahp
> endin
>
>
> Andreas, you could replace dcblock in your code by applying butterhp
> with a cutoff of around 5Hz, like this
> afeed = butterhp(abuzz + adel * 0.99, 5)
> This should allow all the good bass through even within a feedback.
> You can even go much lower with the cutoff: 0.1Hz will also work, it
> will just remove the DC a bit more slowly.
>
> Oeyvind
>
>
> 2016-06-17 12:01 GMT+02:00 Andreas Bergsland :
>> Thanks for clearing that up. Probably better to leave it out of the
>> feedbackloop, then.
>> Andreas
>>
>>> dcblockers are, by definition highpass filters. Not sure whether they
>>> should be placed inside the feedback path, unless there is a specific effect
>>> you want to achieve besides dc blocking. Usually, for that purpose they are
>>> placed at the output.
>>>
>>> Victor Lazzarini
>>> Dean of Arts, Celtic Studies, and Philosophy
>>> Maynooth University
>>> Ireland
>>>
>>>> On 17 Jun 2016, at 09:19, Andreas Bergsland 
>>>> wrote:
>>>>
>>>> Hi,
>>>> Modelled after some of Iain's instruments, I've put in DC blocking in the
>>>> feedback loop to prevent it from building up.
>>>> But I've observed that the dcblock filters in csound (dcblock, dcblock2)
>>>> have an high-pass filtering effect (as demonstrated in the attached csd),
>>>> which naturally gets emphasized when the filter is a part of a feedback
>>>> loop.
>>>> Is the high-pass effect an inevitable result of DC blocking filters?
>>>> Or is it possible to have some kind of DC block without high pass effect?
>>>> Or could an alternative solution be to test the signal average over a
>>>> certain window, and then only apply DC block filtering when the average
>>>> crosses a some (positive or negative) threshold that indicates an
>>>> "unhealthy" DC offset?
>>>> Best,
>>>> Andreas
>>>>
>>>> --
>>>> Andreas Bergsland,
>>>> førsteamanuensis
>>>>
>>>> Musikkteknologiseksjonen
>>>> Institutt for musikk
>>>> Olavskvartalet
>>>> NTNU
>>>> 7491 Trondheim
>>>>
>>>> Besøksadresse: Fjordgt.1 (3.etg.)
>>>> e-post: andreas.bergsland@ntnu.no
>>>> Web: http://folk.ntnu.no/andbe
>>>> Tlf: 7359 0096
>>>> Mob: 4566 3316
>>>>
>>>>
>>>> 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
>>
>>
>> --
>> Andreas Bergsland,
>> førsteamanuensis
>>
>> Musikkteknologiseksjonen
>> Institutt for musikk
>> Olavskvartalet
>> NTNU
>> 7491 Trondheim
>>
>> Besøksadresse: Fjordgt.1 (3.etg.)
>> e-post: andreas.bergsland@ntnu.no
>> Web: http://folk.ntnu.no/andbe
>> Tlf: 7359 0096
>> Mob: 4566 3316
>>
>>
>> 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
>
>


-- 
Andreas Bergsland,
førsteamanuensis

Musikkteknologiseksjonen
Institutt for musikk
Olavskvartalet
NTNU
7491 Trondheim

Besøksadresse: Fjordgt.1 (3.etg.)
e-post: andreas.bergsland@ntnu.no
Web: http://folk.ntnu.no/andbe
Tlf: 7359 0096
Mob: 4566 3316


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