第十二回 実況中継music-dspメーリングリスト!
(2005.07.25)

music-dspというメーリングリストを中心としたWebサイトがあります。
このサイトの趣旨というか、醍醐味は音楽関連の信号処理(実はもう少し広くソフトシンセやソフトエフェクト作り一般)に 特化した内容でメーリングリストが運営されている他、アーカイブと呼ばれるパワフルテクニック集みたいなのがあって、 デジタルフィルタのイロハから、MOOGのフィルタのエミュレート、エイリアスの発生しないオシレータの作り方などなど、 こうしたソフトを作るのに即効力となる知識とソースコードが満載なのです。
ただ、海外のサイトなので言葉が全て英語というのが、ネックとえばネックです。 ですが一度このサイトの味をしめたなら、英語を読むのが苦手な人でも読む価値を十二分に感じて頂けると思うのです!
そこでこの度は、メーリングリストで実際に流れているログを翻訳して掲載してみることにしました!

7/10にCitizen Chunkさんの書き込みによって始まったこのスレッドでは、 真空管のサチュレーションをシミュレートする方法に関する議論が熱く展開されています。 現時点で議論はまだ続いているのですが、とりあえず7/18までのものを載せてみることにしました。
僕自身あまり英語は堪能ではないので、苦しい訳し方も見受けられるかも知れませんが、 後半には原文も載せましたので、ご参考下さい。
雰囲気を醸し出すため、某掲示板風の語調で訳してみました。。。

拙訳


Date: 2005/7/10 16:55:34 From: Citizen Chunk Subject: 真空管・サチュレーション・アルゴリズムの探求 おまいらこんにちは。 その何だ、死ぬほど既出だったらスマソ。 幾らか過去ログを探ってみたが見あたらなかったでつ。 真空管ドライブ回路をエミュったC++のクラスを書こうとしている。 厳密で複雑なものというわけではなくて よくあるキャラクタというのを一般化して、近似みたいなもの(読み込んで、でっち上げる)をやりたい。 ベースとして「完全な真空管アンプのモデル」っていうSimulanalogの記事を使ってまつ。 (これが既出なのは知ってるけど、スレがあまり伸びなかったのよね) この記事の結論というのは、 グリット電圧上で十分に充電されている分離キャパシタが、過渡電流によってよりハーモニックな歪みを引き起こすことと思われる。 漏れは結論の原因となっている大部分の技術内容について知ったかぶりをするつもりはないが、 基本的な概念は分かってるつもりだ。 漏れはまた、上下非対称なウェーブシェイピング、 あるいは対照的だがDCオフセットと組み合わさったウェーブシェイピングによって 真空管回路が偶数次倍音の歪みをより多く作り出すことは分かっている。 うまくいけば、この基礎で興味深い事を思い付けるといいな リアルというわけではないが、それでも楽しめるみたいな。 漏れの最初の目標は波形の加工テクニックをもっと学ぶことだ。 真空管ライクなキャラクタを強調する良いウェーブシェイピングアルゴリズムを思いつくために、 多項式を使ってどのように高調波歪みをコントロールするのかを知りたい。 さらに、サチュレーション量を調整するための過渡電流整流器を入力に適応するつもりだ。 誰か手頃なオンライン(あるいはあるならオフライン)のウェーブシェイピングに関する読み物を知っている? 理想的にはオーディオ用途の強調に関して、さらに理想をいえば真空管サチュレーションについて 扱っているようなものがいい。 具体的な例/公式も歓迎するが、 ただの借り物のコードではなくて、漏れ自身がその内容を理解することができるといいです。 宜しく頼みます。 == chunk
Date: 2005/7/11 0:05:21 From: Vesa Norilo Subject: Re: 真空管・サチュレーション・アルゴリズムの探求 >漏れの最初の目標は波形の加工テクニックをもっと学ぶことだ。 >真空管ライクなキャラクタを強調する良いウェーブシェイピングアルゴリズムを思いつくために、 >多項式を使ってどのようにハーモニックディストーションをコントロールするのかを知りたいのでつ。 >さらに、サチュレーション量を調整するための過渡電流整流器を入力に適応するつもりだ。 > > 実際、これは簡単なもんだ。 漏れが知っている限りではディストーションは通常、それが特定の振幅で入って来るサイン波に対して作られる倍音によって定義される。 ここで入力の振幅を1と仮定しよう。 output = 振幅[倍音の次数] * cos( acos(input) * 倍音の次数) 各々のサイン歯ごとの倍音を得るために、これをいくつかを加えてみろ。 基本的な成分(基音)を含めたいとも思うだろう。 私の記憶が確かならば これらにテイラー級数を利かせれば、藻まえが作朗としている最高次倍音に次数がマッチする素晴らしいウェーブシェイピング多項式を得られる。 とはいえ全く間違っているかも知れん。実際にはこれらをやってみたことはない。 振幅を大きくすれば倍音が増えるし、小さくすれば倍音はへるよ。 より複雑な入力信号では、混変調が発生する。 それでも、出力信号の帯域は(漏れの記憶が確かならば)入力帯域×多項式の次数に制限されている。 それで完全にエイリアシングの面倒を見るには十分にオーバーサンプリングするべきだな。 そうはいっても8倍を超えるオーバーサンプリングは多分無駄だ。 やる前に、事実を確認しる。 漏れは膝の上で講釈を垂れているに過ぎん。 完全に間違った方向へは進んで欲しくない。 Vesa
Date: 2005/7/10 17:29:26 From: Citizen Chunk Subject: Re: 真空管・サチュレーション・アルゴリズムの探求 Vesaサンクス! さっそくやってみよう. 真偽はともかく、 漏れも特定の倍音を強調するウェイブシェイパーを作るため、 チェビシェフ多項式を使用することが書かれているPDFファイルを去年DLしてたのだけれど、 よく分からずじまいだったのよね。(色んなものを集めてるから忘れてた。) 真空管によって作られる倍音の歪曲インデックスについて書かれている ホワイトペーパーかオンライン文章って、他にあるの? さんくすあげいん. == chunk
Date: 2005/7/11 0:39:08 From: Vesa Norilo Subject: Re: 真空管・サチュレーション・アルゴリズムの探求 >真空管によって作られる倍音の歪曲インデックスについて書かれている >ホワイトペーパーかオンライン文章って、他にあるの? > わかったら、漏れにも知らせろ。 とはいえ、それらを評価する素晴らしい方法がある。 藻まえが計りたい機材にサインスウィープをぶっこんで録音しる。 で、自己相関をとるんだ。 得られた結果から歪み成分を観察するんだ。 無相関な倍音は、基本波のエコーのように見えると思う。 Vesa
Date: 2005/7/10 18:02:15 From: Glen Subject: Re: 真空管・サチュレーション・アルゴリズムの探求 >振幅を大きくすれば倍音が増えるし、小さくすれば倍音はへるよ。 作られる倍音が、入力音量によって大きくなるってことで 高次倍音が作られるわけではないんだよね? >より複雑な入力信号では、混変調が発生する。 >それでも、出力信号の帯域は(漏れの記憶が確かならば)入力帯域×多項式の次数に制限されている。 じゃあ、500Hzと700Hzのサイン歯を組み合わせた入力信号を作って、この歪みにかけてみよう。 混変調を考慮に入れなければ、700Hzに対する各々の量の倍音と、500Hzに対しても同じように倍音が作られることだろう。 混変調を考えると、 (700+500)Hzに対する全ての倍音と同じように(700-500)Hzに対する全ての倍音が得られるかな? どうも Glen
Date: 2005/7/11 1:10:00 From: Vesa Norilo Subject: Re: 真空管・サチュレーション・アルゴリズムの探求 >>振幅を大きくすれば倍音が増えるし、小さくすれば倍音はへるよ。 >作られる倍音が、入力音量によって大きくなるってことで >高次倍音が作られるわけではないんだよね? そう、その通り。振幅について言ったつもりだ。 >>より複雑な入力信号では、混変調が発生する。 >>それでも、出力信号の帯域は(漏れの記憶が確かならば)入力帯域×多項式の次数に制限されている。 >じゃあ、500Hzと700Hzのサイン歯を組み合わせた入力信号を作って、この歪みにかけてみよう。 > >混変調を考慮に入れなければ、700Hzに対する各々の量の倍音と、500Hzに対しても同じように倍音が作られることだろう。 >混変調を考えると、 >(700+500)Hzに対する全ての倍音と同じように(700-500)Hzに対する全ての倍音が得られるかな? 藻まえの信号はsin(700t) + sin(500t)だな。 藻まえのウェーブシェイプ関数が、y = x^2なら、 (sin(700t)^2 + 2sin(700t)sin(500t) + sin(500t)^2) が得られるだろう。 sin(x)の2乗は、DC成分と2倍周期のサイン歯に分解される。 中間項が相互変調歪みだ。 ウェーブシェイプのためのより高次の代数学を使うこともできる、 しかし、各時刻での信号自身による単なる乗算が、実は周波数領域での畳み込みになるという事実に頼ることはより簡単だ。 sin(f×t)が周波数領域において正のfと、負のfという2つの周波数を表すことを思い出して欲しい。 なぜならオイラーの定理により、それは1/2(e^(i× f ×t) + e^(i× -f ×t))と表されるからだ。 これで実数信号によるリング変調がなぜ和と差の周波数を生じるのかという理由はとても明白なものとなる。 そして、なぜ複素サイン歯(a complex sinusoid)に対する”リングモジュレータ”がピッチシフターになってしまうかもだ。 とりあえず今夜はこの辺で。 Vesa
Date: 2005/7/10 18:10:38 From: Citizen Chunk Subject: Re: 真空管・サチュレーション・アルゴリズムの探求 >真空管によって作られる倍音の歪曲インデックスについて書かれている >ホワイトペーパーかオンライン文章って、他にあるの? > >わかったら、漏れにも知らせろ。 真偽はともかく、これなんてどうよ?< http://www.sowter.co.uk/harmonics.htm でもまあ、これはあまり細かいことは書かれてないな。具体的な数式もない。 他にも前にググって見つけたものがあった気がするが、今すぐには見つからない。 他に何か見つかったら必ず書くよ。 == chunk
Date: 2005/7/11 1:16:05 From: Vesa Norilo Subject: Re: 真空管・サチュレーション・アルゴリズムの探求 >真偽はともかく、これなんてどうよ?< http://www.sowter.co.uk/harmonics.htm > >でもまあ、これはあまり細かいことは書かれてないな。具体的な数式もない。 >他にも前にググって見つけたものがあった気がするが、今すぐには見つからない。 > >他に何か見つかったら必ず書くよ。 > 他の真空管歪みに見られる顕著な特徴として考えれるものとして、少なくともミラー効果があるよね。 正確な動作は漏れには皆目分からないが、でもそれは高次倍音(高周波?)を減衰させるものだ。 漏れの友が教えてくれたことでは、 真空管アンプのトランスに置ける非線形性が、歪みサウンドに大きな影響を与えているそうだ。 トランスの歪みは低周波で起こりやすい。 多分、それは電流を誘発するという事実からくるのだろう。。。 積分回路→サチュレーター→差分回路によってこの効果を実験してみてはどうだ? 何か全然違ったものになるかも知れん。 Vesa
Date: 2005/7/10 18:49:37 From: Citizen Chunk Subject: Re: 真空管・サチュレーション・アルゴリズムの探求 >漏れの友が教えてくれたことでは、 >真空管アンプのトランスに置ける非線形性が、歪みサウンドに大きな影響を与えているそうだ。 >トランスの歪みは低周波で起こりやすい。 >多分、それは電流を誘発するという事実からくるのだろう。。。 >積分回路→サチュレーター→差分回路によってこの効果を実験してみてはどうだ? >何か全然違ったものになるかも知れん。 禿同。漏れも似たようなことを考えた。 ローパスをかけた”サイドチェイン”の経路を、 フィルタのかかっていない入力波形に対する ウェイブシェイピング用ゲインとして使うというものだ。 (これだと差分回路の必要性はあまり無くなるはずだけど、どうよ?) == chunk
Date: 2005/7/11 2:00:01 From: Vesa Norilo Subject: Re: 真空管・サチュレーション・アルゴリズムの探求 >禿同。漏れも似たようなことを考えた。 >ローパスをかけた”サイドチェイン”の経路を、 >フィルタのかかっていない入力波形に対する >ウェイブシェイピング用ゲインとして使うというものだ。 >(これだと差分回路の必要性はあまり無くなるはずだけど、どうよ?) > (トランスについていってるってこと?) これは「オーバロードは低音で起こりやすい」という法則も満たすと思う。 複雑さを比べてみよう!: 入力→ローパスフィルタのサイドチェイン→エンベローブ・デテクタ→ウェイブシェイピング用ゲイン →調整器→ウェイブシェイパー→出力 入力→積分回路→ウェイブシェイパー→差分回路 漏れの類推では トランスは比較的単純な装置であって、 多分エンベローブ・デテクタは内蔵していないはずだ。 ウェイブシェイピングが働いていない時は前後のフィルタの間のウェイブシェイピングは直線的にする というのを試してみたい。(積分回路/差分回路みたいな) しかしそういうフィルタはベストではないかもしれない (トランス内では電気信号は基本的に電界と磁界の移動により積分され、差分されているのだが) このアプローチの問題点は(実際に)積分回路をリークするような作りにしなくてはならないことだ。 しかし待て!これはバグではなく特徴だ。 トランスは文字通りローエンドに応答落ちを持っている。 異なるサイズのトランスをモデリングするのにリークを実験しさえする必要があるかも知れない。 これを読んでいる中でトランスと電気について実際に知っている人がいたら、参加してくれ。 Vesa
Date: 2005/7/11 10:11:26 From: David Cournapeau Subject: Re: 真空管・サチュレーション・アルゴリズムの探求 >おまいらこんにちは。 >その何だ、死ぬほど既出だったらスマソ。 >幾らか過去ログを探ってみたが見あたらなかったでつ。 > > こんにちは。 こんなページはどうだい?: http://www.simulanalog.org/   (musicdspからここにリンクするのは実に良いアイデアだと思われ。。。) ノシ, david
Date: 2005/7/11 10:41:25 From: David Lowenfels Subject:Re: 真空管・サチュレーション・アルゴリズムの探求 >ベースとして「完全な真空管アンプのモデル」っていうSimulanalogの記事を使ってまつ。 >(これが既出なのは知ってるけど、スレがあまり伸びなかったのよね) > >記事の結論というのは、 >格子電圧上で十分に充電されている分離キャパシタが、過渡電流によってよりハーモニックな歪みを引き起こすことと思われる。 >漏れは結論の原因となっている大部分の技術内容について知ったかぶりをするつもりはないが、 >基本的な概念は分かってるつもりだ。 >漏れはまた、上下非対称なウェーブシェイピング、 >あるいは対照的だがDCオフセットと組み合わさったウェーブシェイピングによって >真空管回路が偶数次倍音の歪みをより多く作り出すことは分かっている。 やあ、Chunk 広範囲に実験したわけではないのだが、 上記の過渡特性を模倣する1つの方法は、 ウェイブシェイパの入力のDCオフセットとして、エンベロープフォロアの出力を(適度な大きさに調整して)使うことだ。 これで非対称な過渡特性が得られるはずだ。 こういうアイデアがある: 入力→積分回路→サイドチェインによるDCオフセットの加算→ウェイブシェイパ/サチュレータ→差分回路→DC成分除去 補間されたルップアップテーブルを使えば、任意のウェイブシェイパを実装できるよ。 -David
Date: 2005/7/11 14:06:36 From: Antti Subject: Re: 真空管・サチュレーション・アルゴリズムの探求 >広範囲に実験したわけではないのだが、 >上記の過渡特性を模倣する1つの方法は、 >ウェイブシェイパの入力のDCオフセットとして、エンベロープフォロアの出力を(適度な大きさに調整して)使うことだ。 >これで非対称な過渡特性が得られるはずだ。 あるいは実際の回路の動作に基づいてそれをやることもできるよね。↓ http://www.tml.tkk.fi/~tmakipat/pubs/paper117.pdf 手短にいうと: 入力+バイアス→非対称ウェイブシェイパ→ハイパス→出力                 →ローパスしてバイアスとしてフィードバック Ftube() というウェイブシェイパを作るのに使われている多項式を見つけられれば、 わかると思う。 このモデルを進歩させることができるが、しかし既にこの音は驚くほど良い。 次のバージョンではもっとちゃんとした測定が必要だろうが、 今のところカスタムの測定装置を造る時間がない。 Simulanalog真空管モデルに注意すると、 x^2/3のパワー法則では、真空管を十分に捕らえていない。 http://www.lynx.bc.ca/%7Ejc/model.htmlを嫁。 Antti PS 真空管自体は実は何もしない。サウンドに大きな影響を与える周辺の回路が必ず必要だ。 PPS. 真空管回路のモデリングに敢えてエンベローブ・フォロアやコンプレッサーを加えるとういのは、 いつでも間違ったやり方だ。(回路が偶然コンプレッサーでもない限りはね) 真空管アンプのコンプレッション効果は、 動的なバイアス電位のシフトと低次の歪み成分の生成によるものだ。 あからさまなコンプレッサーなんかじゃない。
Date: 2005/7/11 14:14:27 From: Citizen Chunk Subject: Re: 真空管・サチュレーション・アルゴリズムの探求 >広範囲に実験したわけではないのだが、 >上記の過渡特性を模倣する1つの方法は、 >ウェイブシェイパの入力のDCオフセットとして、エンベロープフォロアの出力を(適度な大きさに調整して)使うことだ。 >これで非対称な過渡特性が得られるはずだ。 > > >こういうアイデアがある: >入力→積分回路→サイドチェインによるDCオフセットの加算→ウェイブシェイパ/サチュレータ→差分回路→DC成分除去 やあDavid。君の入力に感謝する。 漏れも全く同じ事について考えていた(エンベロープによるDCオフセットの変調だ) 実は今漏れには2つのアイデアがある: (1)エンベロープをDCオフセットの変調に使う(今言った通りのことだ) (2)エンベロープを特定の倍音の変調に使う(例えば2次や、あるいは真空管っぽさを感じさせている何れかにだ) チェビシェフ多項式を使えば簡単なもんだ。 両方とも実験する必要があるな。 それと積分回路と差分回路のコンビについてもやってみよう。 さんくす兄弟。 == chunk
Date: 2005/7/11 14:27:39 From: Citizen Chunk Subject: Re: 真空管・サチュレーション・アルゴリズムの探求 >PPS. >真空管回路のモデリングに敢えてエンベローブ・フォロアやコンプレッサーを加えるとういのは、 >いつでも間違ったやり方だ。(回路が偶然コンプレッサーでもない限りはね) >真空管アンプのコンプレッション効果は、 >動的なバイアス電位のシフトと低次の歪み成分の生成によるものだ。 >あからさまなコンプレッサーなんかじゃない。 確かにそうだね。 これでせいぜい見せかけることくらいはできるだろう。 しかし、当然コンプレッサーにはならない。全然違うものだ。 しかしながらエンベローブフォロア(本当に単純なRC LPFのようなもの)は 「動的なバイアス電位のシフト」を再現できそうではないかと思う、願わくばね。 他の提案もありがとう。 真空管回路の典型的な高調波歪みに関する他の具体的な数字も見てみたい気がする。 これが回路全体の効果の組み合わせを広く一般化したものだということは分かってる。 それでも微妙だとしても他の味付けをする正にクールなものを作りたい。 == chunk
Date: 2005/7/11 14:37:29 From: Farsheed Subject: Re:真空管・サチュレーション・アルゴリズムの探求 やあVesa, >真空管によって作られる倍音の歪曲インデックスについて書かれている >ホワイトペーパーかオンライン文章って、他にあるの? 去年の九月だけど、歪みの理論面に触れる良いコースを選択したんだ。 このページを開いて後ろの方までスクロールダウンすれば 「歪みの理論I&II」と書かれているはずだ。 http://online.physics.uiuc.edu/courses/phys498pom/498pom_lectures.html 何はともあれ実に良い真空管ディストーション理論の断片がそこには詰め込まれている。 教授にコンタクトすることをお勧めするよ、 Steven Errede、彼は真空管の物理特性についてよく知っているからね。 だけど忘れないでくれ、彼は物理学者だ、DSPオタじゃねーからよ。
Date: 2005/7/12 19:31:30 From: Martin Eisenberg Subject: Re:真空管・サチュレーション・アルゴリズムの探求 >真空管によって作られる倍音の歪曲インデックスについて書かれている >ホワイトペーパーかオンライン文章って、他にあるの? この記事にはドライブ量を増やすに従って 最初の2つの倍音がどのように増えていくのかを示す図が幾つか載ってるよ。 http://www.dwfearn.com/tvst1.htm Martin
Date: 2005/7/12 23:16:58 From: Doctor-T Subject: Re:真空管・サチュレーション・アルゴリズムの探求 >広範囲に実験したわけではないのだが、 >上記の過渡特性を模倣する1つの方法は、 >ウェイブシェイパの入力のDCオフセットとして、エンベロープフォロアの出力を(適度な大きさに調整して)使うことだ。 >これで非対称な過渡特性が得られるはずだ。 > > >こういうアイデアがある: >入力→積分回路→サイドチェインによるDCオフセットの加算→ウェイブシェイパ/サチュレータ→差分回路→DC成分除去 何で積分した信号にウェイブシェイプを適応することを提案してるんだい? 真空管は積分なんかしていない波形をシェイプしてるんだぜ。 Thomas
Date: 2005/7/13 1:36:35 From: Citizen Chunk Subject: Re:真空管・サチュレーション・アルゴリズムの探求 >>入力→積分回路→サイドチェインによるDCオフセットの加算→ウェイブシェイパ/サチュレータ→差分回路→DC成分除去 > >何で積分した信号にウェイブシェイプを適応することを提案してるんだい? >真空管は積分なんかしていない波形をシェイプしてるんだぜ。 > 漏れにははっきりわかるよ、これは低周波ほどより強いサチュレーションが起こるという特徴を シミュレートしているんだ。 積分回路は基本的にLPFとして働いているんだと思われ。 フィルタのかかった後の信号がシェイプされる、 その後、差分化されるんだ。(積分を補正するためにね) 正確に分かっているつもりだが、どうだい? 漏れはこれに対するアプローチとして、サイドチェインの経路を含ませるつもりだ。 だからメインの経路は積分回路/差分回路を通らない。 それでサイドチェインにローパスフィルタとDCオフセットをかけるんだ。 ウェイブシェイパもまた増幅率制御値を結果とする計算をするんだ、出力信号そのものの代わりにね。 そうして、この増幅率制御信号がメインの経路に適応されるというわけさ。 == chunk
Date: 2005/7/13 9:50:02 From: Vesa Norilo Subject: Re:真空管・サチュレーション・アルゴリズムの探求 >漏れにははっきりわかるよ、これは低周波ほどより強いサチュレーションが起こるという特徴を >シミュレートしているんだ。 > >積分回路は基本的にLPFとして働いているんだと思われ。 >フィルタのかかった後の信号がシェイプされる、 >その後、差分化されるんだ。(積分を補正するためにね) >正確に分かっているつもりだが、どうだい? たしかにな。 だが私が知っている限りでは、真空管が低い周波数を高い周波数よりも良く歪ませるている分けじゃない。 トランスがそうするんだ。 Vesa
Date: 2005/7/13 12:03:00 From: Citizen Chunk Subject: Re:真空管・サチュレーション・アルゴリズムの探求 トランスと真空管が協同で「動的なサチュレーション」をやってるってこと? 2次や3次以上の倍音の強調もってこと? 質問ばかりでスマソ。 == chunk >>漏れにははっきりわかるよ、これは低周波ほどより強いサチュレーションが起こるという特徴を >>シミュレートしているんだ。 >> >>積分回路は基本的にLPFとして働いているんだと思われ。 >>フィルタのかかった後の信号がシェイプされる、 >>その後、差分化されるんだ。(積分を補正するためにね) >>正確に分かっているつもりだが、どうだい? > >たしかにな。 >だが私が知っている限りでは、真空管が低い周波数を高い周波数よりも良く歪ませるている分けじゃない。 >トランスがそうするんだ。 >
Date: 2005/7/13 21:50:47 From: Vesa Norilo Subject: Re:真空管・サチュレーション・アルゴリズムの探求 トランスは全く直線的に歪むと思われ。 一番それらしいと思われるのは、低周波を強調し、サシュレーターを通して、 お互いを打ち消しあうフィルタのペアで発生するシグマ関数型の歪みだ。 これは模倣に過ぎないが、それなりにうまくいくはずだ。 より良い結果を得るためには実際のデバイスを計測してみることだな。 Vesa >トランスと真空管が協同で「動的なサチュレーション」をやってるってこと? >2次や3次以上の倍音の強調もってこと? > >質問ばかりでスマソ。 > >
Date: 2005/7/13 15:20:49 From: Citizen Chunk Subject: Re:真空管・サチュレーション・アルゴリズムの探求 >トランスは全く直線的に歪むと思われ。 >一番それらしいと思われるのは、低周波を強調し、サシュレーターを通して、 >お互いを打ち消しあうフィルタのペアで発生するシグマ関数型の歪みだ。 >これは模倣に過ぎないが、それなりにうまくいくはずだ。 >より良い結果を得るためには実際のデバイスを計測してみることだな。 > レスをどうもありがとうVesa。 漏れにはまだどうやって2つのフィルタが互いを打ち消しあうのかが正確には分からない。 積分回路と差分回路のペアを昨日試してみた。 でも出力結果はどうしても爆発してしまう。 積分回路のリークも試してみた。 爆発は抑えることができたけど、 気持ち悪いノイズと定期的にブツブツ音が混ざるようになったちゃったのよね。 漏れの積分回路/差分回路は基本的に次のようなものだ integState += in - leak * integState; // 0 < リーク < 1; 通常はleak = 0.001, これでいいかな? in = integState; // 分かりやすさのために、(inへ)手渡す。 diffState = in - diffState; 両者の回路を直列に繋いでみれば、互いに打ち消しあうだろうと推測したんだ。 (リークを考慮に入れないことにして) 何かが間違っているんだろうなぁ。 == chunk
Date: 2005/7/13 17:35:36 From: Citizen Chunk Subject: Re:真空管・サチュレーション・アルゴリズムの探求 OK、積分/差分が上手く動いた。差分回路がバグってた。 > diffState = in - diffState; は、 out = in - previousIn; previousIn = in; でなければならなかった。 現在問題なのは、積分した信号をウェイブシェイパに通すとき、 出力が爆発するということだ。 ウェイブシェイパは正しい。単体で試してみたからね。 積分/差分も正しい。両者の組み合わせだけを試してみたからね。 でも積分→ウェイブシェイパ→差分の組み合わせだと致命的なんだ。 おまいら、何が考えれる? == chunk
Date: 2005/7/14 0:41:52 From: Vesa Norilo Subject: Re:真空管・サチュレーション・アルゴリズムの探求 >ウェイブシェイパは正しい。単体で試してみたからね。 >積分/差分も正しい。両者の組み合わせだけを試してみたからね。 >でも積分→ウェイブシェイパ→差分の組み合わせだと致命的なんだ。 >おまいら、何が考えれる? > > 積分回路をリークするようにするんだってば! 信号処理の言葉で言うとだな、積分回路の反応を保持するものの、 可聴域下の非常に低い周波数を切り離すハイパス回路を加えなければならない。 実際には、藻まえの積分回路のフィードバック係数に 1ではないが1に非常に近い値を設定することだ。 そうしなければ、入力にちょっとでもDC成分があれば大爆発だよ。 V
Date: 2005/7/14 0:46:02 From: Vesa Norilo Subject: Re:真空管・サチュレーション・アルゴリズムの探求 ああ、すまソ。投稿する前に読んで置かなければならなかった、 明らかに藻まえを責める理由はなかったな。 積分フィルタのゲインは可変にする必要がある。 振幅は通常、積分前の信号より少しばかり高いんだ。 DCでのゲインは、fbが藻まえのフィードバック係数だとすると1/(1-fb)になる。 ナイキスト周波数では多分0.5くらいになる。 ウェイブシェイパがフィルタから完全に独立していることは確認したかい? Vesa >積分回路をリークするようにするんだってば! >信号処理の言葉で言うとだな、積分回路の反応を保持するものの、 >可聴域下の非常に低い周波数を切り離すハイパス回路を加えなければならない。 >実際には、藻まえの積分回路のフィードバック係数に >1ではないが1に非常に近い値を設定することだ。 > >そうしなければ、入力にちょっとでもDC成分があれば大爆発だよ。
Date: 2005/7/13 23:48:36 From: Joost Schuttelaar Subject: Re:真空管・サチュレーション・アルゴリズムの探求 >信号処理の言葉で言うとだな、積分回路の反応を保持するものの、 >可聴域下の非常に低い周波数を切り離すハイパス回路を加えなければならない。 >実際には、藻まえの積分回路のフィードバック係数に >1ではないが1に非常に近い値を設定することだ。 だれかオーディオの積分回路/差分回路に関係する他の情報や 何かソースコードは無いか? 中々面白くなってきた(゜▽゜) Joost Schuttelaar
Date: 2005/7/14 1:03:18 From: Vesa Norilo Subject: Re:真空管・サチュレーション・アルゴリズムの探求 > >だれかオーディオの積分回路/差分回路に関係する他の情報や >何かソースコードは無いか? > >中々面白くなってきた(゜▽゜) > 積分回路: output = input + (coef * output); // 理論的には, 完全な積分にはcoefは1、リークさせるなら1未満 見ての通り、零点が無く周波数0に実極を持つ単極フィルタだ。半径は「coef」 差分回路: output = input - last_input; last_input = input; これは周波数πに零点を持つ単零フィルタ。半径は1で極は無い。 Vesa
Date: 2005/7/14 0:08:00 From: Joost Schuttelaar Subject: Re:真空管・サチュレーション・アルゴリズムの探求 > 積分回路: > 差分回路: めちゃいけてるやん。(゜▽゜) ほんまおおきに! (゜▽゜) Joost Schuttelaar
Date: 2005/7/13 18:21:00 From: Citizen Chunk Subject: Re:真空管・サチュレーション・アルゴリズムの探求 やあVesa リークの不足が爆発を引き起こしていることが分かった。 不幸にも、ウェイブシェイパが爆発しないようにするには、 非常に高いリーク(0.999以上)が必要だったんだ。 (当然)積分回路は十分に積分を行わないから、 差分回路は低周波を殆どロールオフしてしまって、 酷い音になってしまう。(カットオフ周波数が非常に高いHPFのようにね) これを相殺できるような差分回路の計算方法って何かある? 差分回路のカットオフ周波数を効果的に下げられるような、 逆リークの類のものってあるの? アフォな質問ばかりしてごめんよ。 あと、 >ウェイブシェイパがフィルタから完全に独立していることは確認したかい? これはどういったこと? == chunk
Date: 2005/7/13 17:56:24 From: inicoderocker Subject: Re:真空管・サチュレーション・アルゴリズムの探求 >これを相殺できるような差分回路の計算方法って何かある? >差分回路のカットオフ周波数を効果的に下げられるような、 >逆リークの類のものってあるの? ウェイブシェイパでは何をやっている? シェイピング関数と、入力信号のどちらかが対称でないとすると、 DCオフセットを引き起こしているはずだよ。 簡単な例だと、 out = in^2 や out = exp(in) だね。 明らかに出力がいつも非負だから、 積分処理は直ぐに爆発する。 もし、DCオフセットを見積もって差し引くことができれば、 (例を挙げるなら典型的な入力信号をウェイブシェイパにかけて、 その出力の長時間の平均を求めるか推測する、それをウェイブシェイパの出力から引けばいい) 積分回路のリークは必要ではあるけど、上手くいけば小さなリークになるはずだ。 CR
Date: 2005/7/13 21:18:58 From: Citizen Chunk Subject: Re:真空管・サチュレーション・アルゴリズムの探求 >これを相殺できるような差分回路の計算方法って何かある? >差分回路のカットオフ周波数を効果的に下げられるような、 >逆リークの類のものってあるの? あ、そうだった!! 差分回路のフィードバックに補完的なリークを作ればいい。 (帰りの地下鉄で思いついたんだ。最高の考えはそこでよく思いつく) これなら積分回路に相対的に大きなリークを作ることができる (だからウェイブシェイパも爆発しなくなる) 差分回路のハイパスをすっとばして出力するんだ。 == chunk
Date: 2005/7/14 18:06:43 From: Martin Eisenberg Subject: Re: [music-dsp] re: 真空管・サチュレーション・アルゴリズムの探求 > integState += in - leak * integState; 全体のDC応答にあわせて入力をスケールするんだ(Vesaの言うようにね) それと時間を明確にする。 integState[n] = leak * in[n] + (1-leak) * integState[n-1] ハイパスはローパスの出力となるintegStateに供給されるのと、 同一の信号にもたらされると思われる。 なので、上の値はそれぞれin[n]→out、integState[n]→in、 integState[n-1]→diffStateと名づけることができる。 outを左辺に独立させて、状態の更新を加える。ほらみて! out = 1/leak * (in - (1-leak) * diffState); diffState = in; ウェイブシェイパが爆発するとはどういうこと? Martin
Date: 2005/7/14 11:47:49 From: David Lowenfels Subject: [music-dsp] re: re: re: 真空管・サチュレーション・アルゴリズムの探求 やあChunk: 君にはサンプリングレートから実際のカットオフ周波数を得るための 若干の数学の遊びを始めることを推奨するよ。 極と零の周波数と伝達関数という言葉で考えるんだ。 展望を得ることにその価値がある。 2つのフィルタの完全な相殺を得るには、(まあ、量子化雑音は割り引くとしよう) 逆数を使うんだ。 H(z) -> 1/H(z) 参考までに、非対称のウェイブシェイパがDCオフセットを生むことも考えられるが、 それは多分小さい。 -D >リークの不足が爆発を引き起こしていることが分かった。 >不幸にも、ウェイブシェイパが爆発しないようにするには、 >非常に高いリーク(0.999以上)が必要だったんだ。 >(当然)積分回路は十分に積分を行わないから、 >差分回路は低周波を殆どロールオフしてしまって、 >酷い音になってしまう。(カットオフ周波数が非常に高いHPFのようにね) > >これを相殺できるような差分回路の計算方法って何かある? >差分回路のカットオフ周波数を効果的に下げられるような、 >逆リークの類のものってあるの? >
Date: 2005/7/15 13:09:55 From: Niko Lange Subject: AW: [music-dsp] re: 真空管・サチュレーション・アルゴリズムの探求 やあAntti, 君の真空管モデルを理解しようとしてみたが、 どうも「→ローパスしてバイアスにフィードバック」というところが難しいんだよね。 多分、こういう文章を読んだ経験が少ないからだと思う。。 FTube()の出力が電源V+と合わさっていることはわかった。 最初の問題は、そこのマイナス符号がV+ -Ftube() を意味するのか、 それとも他の何かを表すのか? 2つ目はV+の定数が、高すぎるように思えることだ。 浮動小数点オーディオで使うためにスケールする必要がある? 最後は、信号の結果はRk/Rpで掛けられている、という漏れの理解が正しいのかどうかだ。 まぬけな質問ばかりでごめんよ。。 Niko
Date: 2005/7/15 15:38:57 From: Citizen Chunk Subject: [music-dsp] re: 真空管・サチュレーション・アルゴリズムの探求 やあMartin. 漏れは差分回路のフィードバックにリークを設けることで、 その問題をすでに解決したよ。 これは積分回路のリークを完全に相殺する、 そしてまた積分回路のリークを非常に高く設定しても問題ない(爆発しないようにできる)。 「爆発」とは、積分化した値を保持しつづけて清算しないことを意味している。 (完全なサイン波だったらいいのにね) これは積分回路のリークでコントロールできるが、これを相殺するためのリークが差分回路に必要となる。 だから、差分回路は面倒なHPFにはならないわけだ。 ところで、君の教えてくれたコードは、厳密な積分回路/差分回路ではなくて 実数の単極LPF/HPFみたいだね。 なぜならそれは入力信号(ゼロ)をスケールするからね。 漏れは他の人が進めている「正真正銘の」積分回路/差分回路を続けていたんだ。 これは基本的には単極のLPFやHPFに似ているけど、ちょっと違うんだ。 == chunk
Date: 2005/7/15 15:49:03 From: Citizen Chunk Subject: [music-dsp] re: 真空管・サチュレーション・アルゴリズムの探求 >やあChunk: >君にはサンプリングレートから実際のカットオフ周波数を得るための >若干の数学の遊びを始めることを推奨するよ。 >極と零の周波数と伝達関数という言葉で考えるんだ。 >展望を得ることにその価値がある。 やあ、David. 漏れは実際の周波数で実行時の係数を決定するために、 簡単な単極LPF/HPFを使うことについても考えた。 でも、結局は正に「リーク」でやってみることに決めたんだ。 リークは両方で同じなんだから、とても簡単だよ。 これでお互いを完全に相殺し合うことができるんだ。 >参考までに、非対称のウェイブシェイパがDCオフセットを生むことも考えられるが、 >それは多分小さい。 もちろん、それでできるよ。 自分自身でもう1つ加えることもできる。(゜▽゜) == chunk
Date: 2005/7/15 23:02:51 From: Martin Eisenberg Subject: re: 真空管・サチュレーション・アルゴリズムの探求 >やあMartin. >漏れは差分回路のフィードバックにリークを設けることで、 >その問題をすでに解決したよ。 漏れが藻まえにこの方法を教えたのは、 上手くすれば、それをやってのけることができると読んだからだ。 ところでフィードバックなんてないよ。 FIRフィルタだもの。 >ところで、君の教えてくれたコードは、厳密な積分回路/差分回路ではなくて >実数の単極LPF/HPFみたいだね。 そうさ、単極/単零フィルタだ。でも藻まえさん自身が「積分回路」と呼んで理解しているそれは、 完全なものなんかじゃないよ。(゜▽゜) Martin
Date: 2005/7/16 0:47:10 From: Vesa Norilo Subject: re: 真空管・サチュレーション・アルゴリズムの探求 >やあ、David. >漏れは実際の周波数で実行時の係数を決定するために、 >簡単な単極LPF/HPFを使うことについても考えた。 >でも、結局は正に「リーク」でやってみることに決めたんだ。 >リークは両方で同じなんだから、とても簡単だよ。 >これでお互いを完全に相殺し合うことができるんだ。 > ...でも藻まえさんウェイブシェイピングに影響しているフィルタのやり方は、 サンプリングレートに依存するよ。 愚考するに、サンプリングレートに基づいて積分回路のリーク量を計算するべきだ。 ところで、差分回路にフィードバックなんてないよ。 Vesa
Date: 2005/7/16 0:51:18 From: Vesa Norilo Subject: re: 真空管・サチュレーション・アルゴリズムの探求 >...でも藻まえさんウェイブシェイピングに影響しているフィルタのやり方は、 >サンプリングレートに依存するよ。 >愚考するに、サンプリングレートに基づいて積分回路のリーク量を計算するべきだ。 それと、これについての漏れのクイック&ダーティな方法はこうだ: 単極/単零ハイパスフィルタ設計手法に関する標準的な問題を使い、 20Hzやそこらに専念する。ゼロ(Hz)は完全に除去する。 論法:完全な積分回路と、DCブロッカーを直列に繋ぐとしたい。 完全な積分回路は0Hzに極をもつし、完全なDCブロッカーは、0Hzに零点を持つ。 周波数領域で掛け合わせれば、それらは相殺されることになる。 残っているのはDCブロッカーの極だ。 よく見れば、それはリークする積分回路の結果だ。 Vesa
Date: Fri, 15 Jul 2005 18:14:53 -0400 From: Citizen Chunk Subject: re: 真空管・サチュレーション・アルゴリズムの探求 >...でも藻まえさんウェイブシェイピングに影響しているフィルタのやり方は、 >サンプリングレートに依存するよ。 >愚考するに、サンプリングレートに基づいて積分回路のリーク量を計算するべきだ。 完璧に正解だ。それについては少しも考えてなかった。 提示してくれてありがとう。 == chunk
Date: 2005/7/15 18:28:21 From: Citizen Chunk Subject: re: 真空管・サチュレーション・アルゴリズムの探求 では、別の質問だ; こうしたサチュレーション曲線を近時するには どんなウェイブシェイピング方法が理想的なんだろうか? チェビシェフ多項式でやってみてるんだが、かなり安っぽいものになっている。 でも他に良い方法はあるのか? exp()を使って変調したtanh()で歪ませる例を見つけた、それだと非対称な ウェイブシェイプができるんだ。 (http://www.csounds.com/ezine/winter1999/processing/) でもまだ試してはいない。 それと、musicdsp.orgのアーカイブにもウェイブシェイプのネタがいっぱいあるよね。 他になんか無いかな? あと、、、信号のエンベローブによって、真空管のグリットのバイアスや、 入力のDC成分をシフトさせる話をしているよね。 これは負側のシフトだけだと仮定できるんだろうか? 別の言い方をすると、 もし入力のDC成分を変調するために、エンベローブの戻りを供給したとすると (ウェイブシェイプに前にやるんだよ)、DC成分は何時も負側で、 シフトは過渡電流に対して、いつでもより負側に押しやるだけって仮定できるの? (漏れは偶数次のウェイブシェイプについては、負側の波形をより歪ませると見ている) == chunk >>...でも藻まえさんウェイブシェイピングに影響しているフィルタのやり方は、 >>サンプリングレートに依存するよ。 >>愚考するに、サンプリングレートに基づいて積分回路のリーク量を計算するべきだ。 > >完璧に正解だ。それについては少しも考えてなかった。 >提示してくれてありがとう。 >
Date: 2005/7/16 16:00:11 From: Urs Heckmann Subject: re: 真空管・サチュレーション・アルゴリズムの探求 やあ、おまいら! このスレは本当に読み応えがあるな! 1つアイデアを思いついた。 カスケード積分コムフィルタ(CIC)を 信号のアップサンプリングやダウンサンプリングに使えると思うんだ。 今までこれを考え抜いたことはなかったが、 多分これは信号をアップサンプリングしてウェイブシェイピングする というのをやるのに必要な帯域制限を得るために、直列の多段にして使えると思われる。 どうやってこれを成し得るのかは正しくは分からないが、すごく簡単にできそうな気がする。 特定の倍音列を構成するための高次のウェイブシェイプを得るのに 安っぽい低次のウェイブシェイプを、間にこのプロセスを挟んで、連結させることができると思う。 ここにナイスなPDFがあります。 http://www.dspguru.com/info/tutor/cic.htm 達者でな、(・▽・)ノ Urs urs heckmann
Date: 2005/7/18 10:07:25 From: dougall Subject: re: 真空管・サチュレーション・アルゴリズムの探求 Niko , これはこのように翻訳されるべきだ。。。 out = lowpass_in ( in * gain ) out = FTube ( out - previous ) previous = lowpass_k( ( V - out) * Rk/Rp ) out = highpass ( out ) 入力値を適切な範囲に収めるためのスケーリングは gain値で行われる。 gainを大きくすればドライブや歪みも強くなる。 この記事では、典型的なgain値を60と書いているが、何も単位が示されていないな。 このモデルでは、各々Rk値と、FTube()関数、ローバスのカットオフ周波数が異なる 3つのステージを並列で使っている。 適切な再生音量を得るためには、3つのステージの最終的な出力をスケールする必要がある。 これは真空管アンプのマスターボリュームに相当するものだ。
Date: 2005/7/18 7:14:30 From: antti Subject: re: 真空管・サチュレーション・アルゴリズムの探求 >入力値を適切な範囲に収めるためのスケーリングは >gain値で行われる。 >gainを大きくすればドライブや歪みも強くなる。 >この記事では、典型的なgain値を60と書いているが、何も単位が示されていないな。 実際にFtube()関数は、典型的な増幅率を60倍としている。 "gain"パラメータの範囲は0〜1だ。(それは電圧をアッテネートするための単なる電位差計だ。) 信号の振幅は電圧を表している。 > このモデルでは、各々Rk値と、FTube()関数、ローバスのカットオフ周波数が異なる >3つのステージを並列で使っている。 Ftubeは入力抵抗が変化する度に再計算する必要がある。 (技術的にいえば前のステージで、gainパラメータが変更されたタイミングでだ) 基本的に Ig = exp(a*Vg+b) = (Vi-Vg)/Ri を数値的に解いて得られるVgを、 Voutを計算してVi,Voutテーブルにそれを保存するために用いる。 a = 6.23 and b = -9.8 Vout(Vg)を使うために、多項式を見つけ出す必要があるな。 >適切な再生音量を得るためには、3つのステージの最終的な出力をスケールする必要がある。 >これは真空管アンプのマスターボリュームに相当するものだ。 全くだ。それと非常に高いS/N比も必要だ。 このシステムの最大増幅率は200000倍(65dB!)になる。 Antti
Date: 2005/7/18 14:05:04 From: Max Subject: re: 真空管・サチュレーション・アルゴリズムの探求 Dougall、 オリジナルの文面によれば、 previous = lowpass_k( ( V - out) * Rk/Rp ) は previous = lowpass_k( ( -out + bias) * Rk/Rp ) とするべきだ。 Max
Date: 2005/7/18 18:33:08 From: Rob Belcham Subject: re: 真空管・サチュレーション・アルゴリズムの探求 うお!、凄いリンクをどうもありがとうUrs。 CICなんていうフィルタは聞いたことがなかった、 今まではIIRのオールパス・ハーフバンドフィルタをアップ/ダウンサンプリング周りの作業に使っていた。 music-dspのアーカイブを参考にしてね(゜▽゜) 恥ずかしながら、 これらのフィルタに真剣に取り組むために、明日、仕事中にちょっとしたmatlabセッションを催さなければならないのだが、 この記事には周波数応答のグラフが無い。 実際にはどんな感じの周波数応答になるんだい? どの程度、ストップパンドを減衰できるの? そしてパスバンドはどの程度「使える」の? これらの直列となった積分回路が、 どのような働きをするのかが頭の中で浮かんでこない、 タップ応答が無限に拡散して、不安定になったりしない? この記事では「リークする」積分回路については言及されていない。 奇妙だよね! Rob >やあ、おまいら! >このスレは本当に読み応えがあるな! > >1つアイデアを思いついた。 >カスケード積分コムフィルタ(CIC)を >信号のアップサンプリングやダウンサンプリングに使えると思うんだ。 >今までこれを考え抜いたことはなかったが、 >多分これは信号をアップサンプリングしてウェイブシェイピングする >というのをやるのに必要な帯域制限を得るために、直列の多段にして使えると思われる。 > >どうやってこれを成し得るのかは正しくは分からないが、すごく簡単にできそうな気がする。 >特定の倍音列を構成するための高次のウェイブシェイプを得るのに >安っぽい低次のウェイブシェイプを、間にこのプロセスを挟んで、連結させることができると思う。 > >ここにナイスなPDFがあります。 >http://www.dspguru.com/info/tutor/cic.htm > >達者でな、(・▽・)ノ > Urs > > >urs heckmann >
Date: 2005/7/18 19:48:54 From: Niko Lange Subject: re: 真空管・サチュレーション・アルゴリズムの探求 助かる説明をしてくれてありがとうDougallとAntti! 漏れは週末それをちょっと試してみた、でもダイアグラムのどこかを読み間違えているらしい。 それを動かすことができるようになれば、理解できると思う。 ではごきげんよう Niko
Date: 2005/7/18 20:10:02 From: Urs Heckmann Subject: re: 真空管・サチュレーション・アルゴリズムの探求 やあRob, ああ、まったく奇妙だ。 漏れはそういう使用方法の大半は、 乗算の難しさを避けられる(乗算がそこには無いという意味で) 固定小数点計算で見受けられると思う。 もう一方で、それは帯域制限に関してはとても苦手としていると思う。 (誰かに聞いたんだけど、誰だったか忘れた、、) 漏れはその出力結果がただの線形補間に実に近かったとしても驚かない。 資格の無い推測をしてすまん。 漏れの少ないDSPの経験の中ではアップ/ダウンサンプリングを何とか避けてきたんだ。 色んなことを試みたけど、いつもその必要を回避する方法を見つけてきた (たとえば、ダブルサンプリング程度で十分だったとかね) しかしながら、それがどういう動作をするのかを正確に知ることは本当にクールだろう。 それが適切な動きをするのなら、 ダブルサンプリングみたいな手法を進化させる簡単な方法になるだろう。 ではごきげんよう(゜▽゜), Urs >うお!、凄いリンクをどうもありがとうUrs。 >CICなんていうフィルタは聞いたことがなかった、 >今まではIIRのオールパス・ハーフバンドフィルタをアップ/ダウンサンプリング周りの作業に使っていた。 >music-dspのアーカイブを参考にしてね(゜▽゜) >恥ずかしながら、 >これらのフィルタに真剣に取り組むために、明日、仕事中にちょっとしたmatlabセッションを催さなければならないですが、 >この記事には周波数応答のグラフが無い。 > >実際にはどんな感じの周波数応答になるんだい? >どの程度、ストップパンドを減衰できるの? >そしてパスバンドはどの程度「使える」の? > >これらの直列となった積分回路が、 >どのような働きをするのかが頭の中で浮かんでこない、 >タップ応答が無限に拡散して、不安定になったりしない? >この記事では「リークする」積分回路については言及されていない。 >奇妙だよね! >
Date: 2005/7/18 19:25:27 From: Rob Belcham Subject: re: 真空管・サチュレーション・アルゴリズムの探求 自己レスしまつ。。。 >恥ずかしながら、 >これらのフィルタに真剣に取り組むために、明日、仕事中にちょっとしたmatlabセッションを催さなければならないのだが、 >この記事には周波数応答のグラフが無い。 Matlabは、固定少数点のブロックセットなしではこうしたフィルタを処理できないようだ。 何故かといえばMATLABの構造体は整数型アキュムレータ(overflowing accumulators) を使う演算に依存しているため、固定点の数値計算にしか対応してないからだ。 >実際にはどんな感じの周波数応答になるんだい? >どの程度、ストップパンドを減衰できるの? >そしてパスバンドはどの程度「使える」の? 周波数応答は矩形窓で切り出したsinc関数のようだった。 減衰は、ステージ数に依存した。 パスバンドの特性は十分使えるとは言えないが、FIRフィルタを使えば応答を均一にできる。 >これらの直列となった積分回路が、 >どのような働きをするのかが頭の中で浮かんでこない、 整数型アキュムレータを使っているわけだから (前回のメールのリンクを見ればどのような働きをしているかが分かるよ) FBGA版の実装の方が乗算を使っていない理由で理想的だ。 でもどのくらいの大きさのアキュムレータが、例えばSHARC DSPのような24Bitオーディオを 動かすのに必要かは確かめてはいない。 そうはいっても面白いフィルタの構造だと思う。 Rob

原文

Message: 11
Date: Sun, 10 Jul 2005 16:55:34 -0400
From: Citizen Chunk
Subject: [music-dsp] tube saturation algorithm research
To: music-dsp


hi all. first of all, my apologies if this topic has been covered to
death already. i did some searching in the archives, but didn't turn
up much on the subject.

i'm trying to write a simple C++ class for an emulated tube drive
circuit. nothing too complex/detailed; more like an approximation
(read: fake), using generalizations of common characteristics.

as a base, i'm using the Simulanalog paper, "A Complete Model of a
Tube Amplifier". (i know i've brought it up here before, but the
thread never went very far.) in the article, the conclusion seems to
be that the decoupling capacitor on the grid voltage, as it is
charging up, causes more harmonic distortion on transients. i won't
pretend to understand most of the engineering leading up to the
conclusion ;); but i do understand the basic concepts.

i also understand that tube circuits cause more even-order harmonic
distortion, which can be approximated with an asymmetrical waveshaper,
or a symmetrical waveshaper combined with a DC offset.

hopefully, with this basis, i can come up with something
interesting--albeit not realistic, but "fun" nonetheless.

my first goal is to learn more about waveshaping techniques. i would
like to understand how to control harmonic distortion with
polynomials, in order to come up with a good waveshaping algorithm for
emphasizing tube-like characteristics. later on, i'll apply
transient-detection to the input to modulate the ammount of
saturation.

does anyone here know of some good online (or offline, if it exists
anymore ;)) reading on the subject of waveshaping, ideally with an
emphasis on audio applications; even more ideally, something that
discusses tube saturation.

concrete examples/formulas are also welcome, but i would prefer to be
able to understand this stuff myself, not just borrow code.

thanks.

== chunk


------------------------------


Message: 1
Date: Mon, 11 Jul 2005 00:05:21 +0300
From: Vesa Norilo
Subject: Re: [music-dsp] tube saturation algorithm research
To: music-dsp


>my first goal is to learn more about waveshaping techniques. i would
>like to understand how to control harmonic distortion with
>polynomials, in order to come up with a good waveshaping algorithm for
>emphasizing tube-like characteristics. later on, i'll apply
>transient-detection to the input to modulate the ammount of
>saturation.
>  
>
This is quite simple, actually..

AFAIK distortion is usually defined by the harmonics it creates to a 
incoming sinusoid at a certain amplitude. Let's assume input amplitude 1 
for this:

output = amplitude[harmonic_number] * cos( acos(input) * harmonic_number)

Add several of these to get multiple harmonics for each sinusoid. You 
will also want to include some fundamental (first harmonic).

IIRC when you work Taylor serii on these things you get nice waveshaping 
polynomials whose order matches the highest harmonic you're creating. I 
might be totally wrong though, I've never done it in practice.

You get more harmonics when you increase input amplitude, less when you 
decrease it.

For more complicated input signals, intermodulation products are 
created. However, the output signal (IIRC) is bandlimited to input_band 
* polynomial_order. So to take care of aliasing completely, you will 
want to oversample that much. Oversampling beyond 8 x is probably a 
waste though.

Check the facts before proceeding, I'm just firing from lap here. 
Hopefully I won't start you into a completely ridicilous direction ;)

Vesa




------------------------------

Message: 2
Date: Sun, 10 Jul 2005 17:29:26 -0400
From: Citizen Chunk
Subject: Re: [music-dsp] tube saturation algorithm research
To: music-dsp

thanks Vesa! i will try this out.

FWIW, i also stumbled upon a PDF doc that i had downloaded last year
(i collect a lot of stuff and often forget about it) that describes
using Chebychev polynomials to create waveshapers that emphasize
certain harmonics.

is there any white paper or online reading that states the distortion
indexes of the harmonics that a tube creates?

thanks again.

== chunk


On 7/10/05, Vesa Norilo
> 
> >my first goal is to learn more about waveshaping techniques. i would
> >like to understand how to control harmonic distortion with
> >polynomials, in order to come up with a good waveshaping algorithm for
> >emphasizing tube-like characteristics. later on, i'll apply
> >transient-detection to the input to modulate the ammount of
> >saturation.
> >
> >
> This is quite simple, actually..
> 
> AFAIK distortion is usually defined by the harmonics it creates to a
> incoming sinusoid at a certain amplitude. Let's assume input amplitude 1
> for this:
> 
> output = amplitude[harmonic_number] * cos( acos(input) * harmonic_number)
> 
> Add several of these to get multiple harmonics for each sinusoid. You
> will also want to include some fundamental (first harmonic).
> 
> IIRC when you work Taylor serii on these things you get nice waveshaping
> polynomials whose order matches the highest harmonic you're creating. I
> might be totally wrong though, I've never done it in practice.
> 
> You get more harmonics when you increase input amplitude, less when you
> decrease it.
> 
> For more complicated input signals, intermodulation products are
> created. However, the output signal (IIRC) is bandlimited to input_band
> * polynomial_order. So to take care of aliasing completely, you will
> want to oversample that much. Oversampling beyond 8 x is probably a
> waste though.
> 
> Check the facts before proceeding, I'm just firing from lap here.
> Hopefully I won't start you into a completely ridicilous direction ;)
> 
> Vesa
> 
> 
> --
> dupswapdrop -- the music-dsp mailing list and website:
> subscription info, FAQ, source code archive, list archive, book reviews, dsp links
> http://shoko.calarts.edu/musicdsp
> http://ceait.calarts.edu/mailman/listinfo/music-dsp
>


------------------------------

Message: 3
Date: Mon, 11 Jul 2005 00:39:08 +0300
From: Vesa Norilo 
Subject: Re: [music-dsp] tube saturation algorithm research
To: music-dsp


>
>is there any white paper or online reading that states the distortion
>indexes of the harmonics that a tube creates?
>
>  
>

If you find one, let me know.

However, there's a nice way to measure them.

Record a sine sweep through the equipment you measure. Do 
autocorrelation. Observe distortion components in the result. You see, 
it thinks that the extraneous harmonics are 'echoes' of the primary sine 
sweep.

Vesa


------------------------------

Message: 4
Date: Sun, 10 Jul 2005 18:02:15 -0400
From: Glen 
Subject: Re: [music-dsp] tube saturation algorithm research
To: music-dsp

At 05:05 PM 7/10/2005, Vesa Norilo wrote:

>You get more harmonics when you increase input amplitude, less when you 
>decrease it.

I assume that you mean harmonics generated are larger in amplitude, and not 
that a greater number of harmonics generated?


>For more complicated input signals, intermodulation products are created. 
>However, the output signal (IIRC) is bandlimited to input_band * 
>polynomial_order. So to take care of aliasing completely, you will want to 
>oversample that much. Oversampling beyond 8 x is probably a waste though.

So, let's say I have the composite input signal of a 700 Hz sine wave, and 
a 500 Hz sine wave. Then, I apply this distortion to the signal.

I assume I would generate various amounts of all the harmonics of 700 Hz, 
along with all the harmonics of 500 Hz -- before allowing for intermodulation?

With intermodulation considered, do I then get all the harmonics of 
(700-500) Hz, as well as all the harmonics of (700+500) Hz?


Thanks,
Glen


------------------------------

Message: 5
Date: Mon, 11 Jul 2005 01:10:00 +0300
From: Vesa Norilo 
Subject: Re: [music-dsp] tube saturation algorithm research
To: music-dsp 


>
>> You get more harmonics when you increase input amplitude, less when 
>> you decrease it.
>
>
> I assume that you mean harmonics generated are larger in amplitude, 
> and not that a greater number of harmonics generated?

Yes, exactly. I mean the amplitude.

>> For more complicated input signals, intermodulation products are 
>> created. However, the output signal (IIRC) is bandlimited to 
>> input_band * polynomial_order. So to take care of aliasing 
>> completely, you will want to oversample that much. Oversampling 
>> beyond 8 x is probably a waste though.
>
>
> So, let's say I have the composite input signal of a 700 Hz sine wave, 
> and a 500 Hz sine wave. Then, I apply this distortion to the signal.
>
> I assume I would generate various amounts of all the harmonics of 700 
> Hz, along with all the harmonics of 500 Hz -- before allowing for 
> intermodulation?
>
> With intermodulation considered, do I then get all the harmonics of 
> (700-500) Hz, as well as all the harmonics of (700+500) Hz?


Your signal is sin(700 t) + sin(500 t). If your waveshaping function is 
y = x^2 then you get (sin ^2 (700t) + 2 sin(700t)sin(500t) + 
sin^2(500t)). sin^2 (x) reduces to DC and sinusoid at 2x, the middle 
term is intermodulation distortion.

You can work the algebra for higher order waveshapers as well, but it's 
easier just to rely on the fact that each time the signal is multiplied 
with itself, it's convolution in the frequency domain. Just remember 
that sin(f t) represents both +f and -f frequencies in the frequency 
domain, because it's 1/2(e^(i f t) + e^(i -f t)) via Euler's theorem.

Then it becomes pretty obvious why ring modulation with real signals 
produces sum and difference frequencies. And why a "ring modulator" with 
a complex sinusoid becomes a frequency shifter. But let's not go there 
tonight ;)

Vesa





------------------------------

Message: 6
Date: Sun, 10 Jul 2005 18:10:38 -0400
From: Citizen Chunk 
Subject: Re: [music-dsp] tube saturation algorithm research
To: music-dsp


On 7/10/05, Vesa Norilo

> >is there any white paper or online reading that states the distortion
> >indexes of the harmonics that a tube creates?

> If you find one, let me know.

FWIW, i found this page: http://www.sowter.co.uk/harmonics.htm

but it doesn't go into much detail. no concrete numbers. i believe
i've found others in preliminary googling, but can't find them right
now.

i'll definitely post any findings.

== chunk


------------------------------

Message: 7
Date: Mon, 11 Jul 2005 01:16:05 +0300
From: Vesa Norilo
Subject: Re: [music-dsp] tube saturation algorithm research
To: music-dsp



>FWIW, i found this page: http://www.sowter.co.uk/harmonics.htm
>
>but it doesn't go into much detail. no concrete numbers. i believe
>i've found others in preliminary googling, but can't find them right
>now.
>
>i'll definitely post any findings.
>  
>
Other significant characteristics of what we think of as tube distortion 
are at least the Miller effect, the precise mechanism of which I have no 
idea about, but it does attenuate the higher harmonics (or frequencies?)

My friend informs me that the nonlinearity in transformers in tube 
amplifiers accounts for a large part of the sound of the distortion. 
Transformers saturate easily with bass frequencies. Maybe that's due to 
the fact that they induce current... you might want to experiment with 
integrator -> saturator -> differentiator to get this effect. Or it 
might be something completely different.

Vesa


------------------------------

Message: 9
Date: Sun, 10 Jul 2005 18:49:37 -0400
From: Citizen Chunk
Subject: Re: [music-dsp] tube saturation algorithm research
To: music-dsp


> My friend informs me that the nonlinearity in transformers in tube
> amplifiers accounts for a large part of the sound of the distortion.
> Transformers saturate easily with bass frequencies. Maybe that's due to
> the fact that they induce current... you might want to experiment with
> integrator -> saturator -> differentiator to get this effect. Or it
> might be something completely different.

yes, i thought about something similar, using a low-pass filtered
"sidechain" path to calculate a waveshaping gain and applying that to
the unfiltered input. (that would alleviate the necessity of the
differentiator, right?)

== chunk


------------------------------

Message: 10
Date: Mon, 11 Jul 2005 02:00:01 +0300
From: Vesa Norilo
Subject: Re: [music-dsp] tube saturation algorithm research
To: music-dsp 


>yes, i thought about something similar, using a low-pass filtered
>"sidechain" path to calculate a waveshaping gain and applying that to
>the unfiltered input. (that would alleviate the necessity of the
>differentiator, right?)
>  
>
(Talking about the transformer I guess?)

I guess that also fulfills the criterion "overloads easily with low 
frequencies"..

Let's examine the relative complexity:

Input -> Sidechain LP Filter -> Envelope detector -> Waveshaper Gain 
adjustment logic -> Waveshaper -> Output

Input -> Integrator -> Waveshaper -> Differentiator

My guess is that a transformer is a relatively simple device and 
probably doesn't have a built-in envelope detector. I would be inclined 
to try to use straight waveshaping with pre and post filtering that 
cancel out when the waveshaping isn't active (such as integrator / 
differentiator). However, those filters may not be the best (altough 
they may well be - in a transformer the electric signal is essentially 
integrated and differentiated due to moving from voltage to magnetic 
field to voltage).

A problem in my approach is that you must (in practice) make the 
integrator leaky. But wait! This is not a bug, it's a feature. 
Transformers namely have a response drop in the low end. You might even 
experiment with the leak to model different size transformers ;)

If there's someone reading who actually knows something about 
transformers and electricity, please chime in ;)

Vesa


----------------------------------------------------------------------

Message: 1
Date: Mon, 11 Jul 2005 10:11:26 +0900
From: David Cournapeau
Subject: Re: [music-dsp] tube saturation algorithm research
To: music-dsp

Citizen Chunk wrote:

>hi all. first of all, my apologies if this topic has been covered to
>death already. i did some searching in the archives, but didn't turn
>up much on the subject.
>  
>
Hi,

    You may want to try this page:

    http://www.simulanalog.org/ (it may actually be a good idea to link 
to them on musicdsp...)

    Cheers,

    david



Message: 2
Date: Mon, 11 Jul 2005 10:41:25 -0700
From: David Lowenfels
Subject: [music-dsp] re: tube saturation algorithm research
To: music-dsp


  Citizen Chunk wrote:
> as a base, i'm using the Simulanalog paper, "A Complete Model of a
> Tube Amplifier". (i know i've brought it up here before, but the
> thread never went very far.) in the article, the conclusion seems to
> be that the decoupling capacitor on the grid voltage, as it is
> charging up, causes more harmonic distortion on transients. i won't
> pretend to understand most of the engineering leading up to the
> conclusion ;); but i do understand the basic concepts.
>
> i also understand that tube circuits cause more even-order harmonic
> distortion, which can be approximated with an asymmetrical waveshaper,
> or a symmetrical waveshaper combined with a DC offset.

Hi Chunk:
   I haven't experimented extensively with this, but one way to  
emulate the above-mentioned transient effect is to use the output of  
an envelope follower (scaled appropriately) as a DC offset to the  
input of the waveshaper. This way you get a transient asymmetry.

Here's an idea:

input -> integrator -> sum with sidechain DC offset -> waveshaper/ 
saturator -> differentiator -> DC blocker


You can implement an arbitrary waveshaper is with an interpolated  
lookup-table.

-David


------------------------------

Message: 3
Date: Mon, 11 Jul 2005 14:06:36 -0400 (EDT)
From: antti
Subject: Re: [music-dsp] re: tube saturation algorithm research
To: music-dsp 


On Mon, 11 Jul 2005, David Lowenfels wrote:

>  I haven't experimented extensively with this, but one way to emulate the 
> above-mentioned transient effect is to use the output of an envelope follower 
> (scaled appropriately) as a DC offset to the input of the waveshaper. This 
> way you get a transient asymmetry.

Or you could do it the way the actual circuits work:
http://www.tml.tkk.fi/~tmakipat/pubs/paper117.pdf

In short:
input + bias -> asymmetric waveshaper -> highpass -> output
                                       -> lowpass and feedback to bias

I'll see if I can find the polynomial used in building the Ftube() 
waveshaper.

The model could be improved but already sounds surprisingly good. Next 
version would require better measurements and I don't currently have the 
time to build the custom measurement equipment.

Beware of the Simulanalog tube model - x^2/3 power law does NOT hold for 
tubes. See http://www.lynx.bc.ca/%7Ejc/model.html

Antti

Ps. A tube by itself cannot do anything. It always needs extra circuitry 
around it which has a huge effect on the sound.

Pps. Anytime you're adding explicit envelope followers or compressors to 
model tube circuitry, you're doing it wrong (unless the unit happens to be 
a compressor). The compression effects of tube amplifiers are due to the 
dynamic shifting of the bias voltage and the low order distortion 
products, not any explicit compressor.


------------------------------

Message: 4
Date: Mon, 11 Jul 2005 14:14:27 -0400
From: Citizen Chunk
Subject: Re: [music-dsp] re: tube saturation algorithm research
To: music-dsp 


On 7/11/05, David Lowenfels wrote:
>    I haven't experimented extensively with this, but one way to
> emulate the above-mentioned transient effect is to use the output of
> an envelope follower (scaled appropriately) as a DC offset to the
> input of the waveshaper. This way you get a transient asymmetry.
> 
> Here's an idea:
> 
> input -> integrator -> sum with sidechain DC offset -> waveshaper/
> saturator -> differentiator -> DC blocker

hi David. thanks for your input. i had thought of the exact same thing
(envelope modulating DC offset). actually, i now have 2 ideas:

1) use the envelope to modulate the DC offset (as you've said)

2) use the envelope to modulate just specific harmonics (i.e. 2nd, or
whatever sounds "tubey" ... er, "tubular"?). using the Chebyshev
polynomials makes this a piece o' cake.

i'll have to experiment with both. i'll also play around with the
integrator/differentiator combo.

thanks bros.

== chunk


------------------------------

Message: 6
Date: Mon, 11 Jul 2005 14:27:39 -0400
From: Citizen Chunk 
Subject: Re: [music-dsp] re: tube saturation algorithm research
To: music-dsp


On 7/11/05, antti wrote:

> Pps. Anytime you're adding explicit envelope followers or compressors to
> model tube circuitry, you're doing it wrong (unless the unit happens to be
> a compressor). The compression effects of tube amplifiers are due to the
> dynamic shifting of the bias voltage and the low order distortion
> products, not any explicit compressor.

right, yes, i know that this going to be a fake, at best. but it's not
going to be a compressor, per se; far from it. though the envelope
follower (which is really just like a simple RC LPF) should recreate
the "dynamic shifting of the bias voltage"--i hope.

thanks for your other suggestions too.

i'd be curious to see some concrete numbers on typical harmonic
distortion with tube circuits. i know that this is a sweeping
generalization of the combined effect of the circuit as a whole; but
i'd just like to make something cool, with a little character, to add
to other "character projects".

== chunk


------------------------------

Message: 7
Date: Mon, 11 Jul 2005 14:37:29 -0700 (PDT)
From: Farsheed
Subject: Re: [music-dsp] tube saturation algorithm research
To: music-dsp 

Hey Vesa,

> is there any white paper or online reading that
> states the distortion
> indexes of the harmonics that a tube creates?

Last semester I took a good course that touched on
theories of distortion.  You may want to check out
this page and scroll down to the bottom where it says,
"theory of distortion I and II"

http://online.physics.uiuc.edu/courses/phys498pom/498pom_lectures.html

Actually there is quite a good bit of tube distortion
theory stuff on their anyway.  I encourage you to
contact the professor, Steven Errede, who knows a lot
about tube physics.  But remember, he is a physicist,
not a DSP guy ;)




__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


------------------------------

Message: 8
Date: Tue, 12 Jul 2005 19:31:30 +0200
From: Martin Eisenberg
Subject: Re: [music-dsp] tube saturation algorithm research
To: music-dsp

From: "Citizen Chunk"

> is there any white paper or online reading that states the
> distortion indexes of the harmonics that a tube creates?

This article has some figures showing how the first couple
harmonics rise with increasing drive:
http://www.dwfearn.com/tvst1.htm


Martin



------------------------------

Message: 9
Date: Tue, 12 Jul 2005 23:16:58 +0200
From: Doctor-T
Subject: Re: [music-dsp] re: tube saturation algorithm research
To: music-dsp


> Hi Chunk:
>   I haven't experimented extensively with this, but one way to  
> emulate the above-mentioned transient effect is to use the output of  
> an envelope follower (scaled appropriately) as a DC offset to the  
> input of the waveshaper. This way you get a transient asymmetry.
> 
> Here's an idea:
> 
> input -> integrator -> sum with sidechain DC offset -> waveshaper/ 
> saturator -> differentiator -> DC blocker

Why do you propose to apply the waveshaper in the integrated signal?
Tubes are shaping the signal not integrated.

Thomas



------------------------------

Message: 10
Date: Wed, 13 Jul 2005 01:36:35 -0400
From: Citizen Chunk
Subject: Re: [music-dsp] re: tube saturation algorithm research
To: music-dsp 


On 7/12/05, Doctor-T  wrote:

> > input -> integrator -> sum with sidechain DC offset -> waveshaper/
> > saturator -> differentiator -> DC blocker
> 
> Why do you propose to apply the waveshaper in the integrated signal?
> Tubes are shaping the signal not integrated.
> 

i'm pretty sure that this is to simulate the characteristic of more
saturation of low frequencies. i believe that the integrator is
basically acting as a LPF. the filtered signal is then shaped, then
differentiated (to compensate for the integration). do i understand
this correctly?

my approach to this would involve a sidechain path, so that the main
path doesn't go through the integrator/differentiator. as such, the
sidechain would be low-pass filtered and DC offset. the waveshaper
algo can be manipulated to return a gain control value, instead of the
output signal. then this gain control signal can be applied to the
main path.

== chunk



----------------------------------------------------------------------

Message: 1
Date: Wed, 13 Jul 2005 09:50:02 +0300
From: Vesa Norilo 
Subject: Re: [music-dsp] re: tube saturation algorithm research
To: music-dsp 


>i'm pretty sure that this is to simulate the characteristic of more
>saturation of low frequencies. i believe that the integrator is
>basically acting as a LPF. the filtered signal is then shaped, then
>differentiated (to compensate for the integration). do i understand
>this correctly?
>  
>
Yes, but AFAIK, tubes don't distort low frequencies more than high 
frequencies, transformers do.

Vesa


------------------------------

Message: 2
Date: Wed, 13 Jul 2005 12:03:00 -0400
From: Citizen Chunk
Subject: Re: [music-dsp] re: tube saturation algorithm research
To: music-dsp

do transformers share the same "dynamic saturation" that tubes
exhibit? also, do they also emphasize the second harmonic? or are they
more third harmonic?

sorry for all the questions.

== chunk

On 7/13/05, Vesa Norilo wrote:
> 
> >i'm pretty sure that this is to simulate the characteristic of more
> >saturation of low frequencies. i believe that the integrator is
> >basically acting as a LPF. the filtered signal is then shaped, then
> >differentiated (to compensate for the integration). do i understand
> >this correctly?
> >
> >
> Yes, but AFAIK, tubes don't distort low frequencies more than high
> frequencies, transformers do.
> 
> Vesa
> --
> dupswapdrop -- the music-dsp mailing list and website:
> subscription info, FAQ, source code archive, list archive, book reviews, dsp links
> http://shoko.calarts.edu/musicdsp
> http://ceait.calarts.edu/mailman/listinfo/music-dsp
>


------------------------------

Message: 3
Date: Wed, 13 Jul 2005 21:50:47 +0300
From: Vesa Norilo 
Subject: Re: [music-dsp] re: tube saturation algorithm research
To: music-dsp 

I think transformers just saturate in a quite straightforward fashion. I 
think my best guess would be a sigma function saturation, but happening 
in between a pair of filters that emphasize bass frequencies for the 
saturator and cancel each other out normally. This would be just a 
mock-up but should do reasonably well. You need to measure actual 
devices if you want to do better.

Vesa

>do transformers share the same "dynamic saturation" that tubes
>exhibit? also, do they also emphasize the second harmonic? or are they
>more third harmonic?
>
>sorry for all the questions.
>
>  
>
>



------------------------------

Message: 4
Date: Wed, 13 Jul 2005 15:20:49 -0400
From: Citizen Chunk
Subject: Re: [music-dsp] re: tube saturation algorithm research
To: music-dsp 

On 7/13/05, Vesa Norilo  wrote:
> I think transformers just saturate in a quite straightforward fashion. I
> think my best guess would be a sigma function saturation, but happening
> in between a pair of filters that emphasize bass frequencies for the
> saturator and cancel each other out normally. This would be just a
> mock-up but should do reasonably well. You need to measure actual
> devices if you want to do better.
>

thanks for the input Vesa. i'm still not sure exactly how you can have
2 filters that just cancel each other out. i tried an
integrator/differentiator pair yesterday, but the output just blew up.
i tried manipulating the leak on the integrator, which stopped it from
blowing up, but i still got weird noises and occaisional "eruptions".

my integrator/differentiator is basically as follows:

integState += in - leak * integState; // 0 < leak < 1; leak usually =
0.001, right?

in = integState; // hand-off, for clarity

diffState = in - diffState;

i assumed that using them in series would just cancell each other out
(not taking into account the leak). guess i'm doing something wrong.

== chunk


------------------------------

Message: 5
Date: Wed, 13 Jul 2005 17:35:36 -0400
From: Citizen Chunk
Subject: Re: [music-dsp] re: tube saturation algorithm research
To: music-dsp

ok, i got my integ/diff working. i had a bug in my differentiator:

> diffState = in - diffState;

should have been:

out = in - previousIn;
previousIn = in;

the problem now is that the output blows up when i pass the integrated
signal through the waveshaper. the waveshaper is fine, because i've
tested it on its own. the integ/diff are fine, because i've tested
them on their own. but the combination of integ->waveshaper->diff is
lethal. any thoughts, guys?

== chunk


------------------------------

Message: 6
Date: Thu, 14 Jul 2005 00:41:52 +0300
From: Vesa Norilo
Subject: Re: [music-dsp] re: tube saturation algorithm research
To: music-dsp 


>the problem now is that the output blows up when i pass the integrated
>signal through the waveshaper. the waveshaper is fine, because i've
>tested it on its own. the integ/diff are fine, because i've tested
>them on their own. but the combination of integ->waveshaper->diff is
>lethal. any thoughts, guys?
>  
>
Make your integrator leak! In signal processing terms, you should add a 
high pass component that preserves the integrator response but cuts out 
the very lowest frequencies below the audio range. In practice, this is 
achieved by making your integrator feedback coefficent not 1 but 
something quite near 1.

Otherwise, if there's any DC in your input signal, it's just going to 
explode.

V


------------------------------

Message: 7
Date: Thu, 14 Jul 2005 00:46:02 +0300
From: Vesa Norilo 
Subject: Re: [music-dsp] re: tube saturation algorithm research
To: music-dsp 

Oh, I should read before posting. That wasn't your problem obviously.

You need to factor in the integrator filter gain. The amplitude will be 
usually quite a bit higher than non-integrated signal. The gain at dc is 
going to be 1/(1-fb) where fb is your feedback coefficent. At Nyquist 
it's probably going to be around 0.5

Are you sure that the waveshaper is totally decoupled from the filters?

Vesa

>>
> Make your integrator leak! In signal processing terms, you should add 
> a high pass component that preserves the integrator response but cuts 
> out the very lowest frequencies below the audio range. In practice, 
> this is achieved by making your integrator feedback coefficent not 1 
> but something quite near 1.
>
> Otherwise, if there's any DC in your input signal, it's just going to 
> explode.
>
> V
> -- 
> dupswapdrop -- the music-dsp mailing list and website: subscription 
> info, FAQ, source code archive, list archive, book reviews, dsp links 
> http://shoko.calarts.edu/musicdsp 
> http://ceait.calarts.edu/mailman/listinfo/music-dsp




------------------------------

Message: 8
Date: Wed, 13 Jul 2005 23:48:36 +0200
From: Joost Schuttelaar
Subject: Re: [music-dsp] re: tube saturation algorithm research
To: music-dsp 


Vesa Norilo wrote:

> Make your integrator leak! In signal processing terms, you should add a 
> high pass component that preserves the integrator response but cuts out 
> the very lowest frequencies below the audio range. In practice, this is 
> achieved by making your integrator feedback coefficent not 1 but 
> something quite near 1.

Can someone post some source code or other resources of audio 
integrators/differentiator?

Quite fascinated :)

-- 

Joost Schuttelaar


------------------------------

Message: 9
Date: Thu, 14 Jul 2005 01:03:18 +0300
From: Vesa Norilo 
Subject: Re: [music-dsp] re: tube saturation algorithm research
To: music-dsp 



>
> Can someone post some source code or other resources of audio 
> integrators/differentiator?
>
> Quite fascinated :)
>
Integrator:

output = input + (coef * output); // where in theory, coef is 1 for a 
perfect integrator, <1 for a leaky one

As you see, it is a one-pole filter with no zero and a real pole at 
frequency 0, radius "coef"


Differentiator:

output = input - last_input;
last_input = input;

It is a one-zero filter with a zero at frequency Pi, radius 1 and no pole.

Vesa



------------------------------

Message: 10
Date: Thu, 14 Jul 2005 00:08:00 +0200
From: Joost Schuttelaar
Subject: Re: [music-dsp] re: tube saturation algorithm research
To: music-dsp 


Vesa Norilo wrote:

> Integrator:

> Differentiator:

Extremely cool :) thanks heaps! :)

-- 

Joost Schuttelaar


------------------------------

Message: 11
Date: Wed, 13 Jul 2005 18:21:00 -0400
From: Citizen Chunk 
Subject: Re: [music-dsp] re: tube saturation algorithm research
To: music-dsp 

hi Vesa. i figured out the the absense of the leak was causing the
blow up. unfortunately, it also needs a very high leak (~0.999) in
order for the waveshaper not to blow up. (understandably.) since the
integrator is thus not doing much integrating, the differentiator
rolls off all of the low frequency, making it sound horrible. (like a
HPF with a very high Fc.)

is there some way to manipulate the differentiator to compensate for
this? is there some sort of "reverse leak" that can, effectively, push
the differentiator's Fc way down?

sorry to post so many stupid questions guys.

also...
> Are you sure that the waveshaper is totally decoupled from the filters?

what does this mean?

== chunk


----------------------------------------------------------------------

Message: 1
Date: Wed, 13 Jul 2005 17:56:24 -0700 (MST)
From: inicoderocker
Subject: Re: [music-dsp] re: tube saturation algorithm research
To: music-dsp


On Wed, 13 Jul 2005, Citizen Chunk wrote:

> is there some way to manipulate the differentiator to compensate for
> this? is there some sort of "reverse leak" that can, effectively, push
> the differentiator's Fc way down?

What is you wave shaper doing? If either the shaping function or the 
input signal are not symmetrical you'll probably introduce a DC offset
A simple case would be

out = in^2

or

out = exp(in)

obviously the output is always positive, so the integral will blow up 
quickly. If you can estimate the DC offset introduced and subtract it off 
--say take the output of the wave shaper for a "typical" input and average 
it for a long time or just guess, then just subtract this value from the 
output of the wave shaper --you'll still need the leaky integrator, but 
hopefully less leak.

   CR


------------------------------

Message: 2
Date: Wed, 13 Jul 2005 21:18:58 -0400
From: Citizen Chunk
Subject: Re: [music-dsp] re: tube saturation algorithm research
To: music-dsp 


> is there some way to manipulate the differentiator to compensate for
> this? is there some sort of "reverse leak" that can, effectively, push
> the differentiator's Fc way down?

duh! of course! you just create a complementary leak in the
differentiator's feedback. (realized this on the subway home. i do
some of my best thinking there.)

so this allows me to create a relatively large leak in the integrator
(so that the waveshaper doesn't blow up), without the differentiator
hi-pass filtering the hell out of the output.

== chunk



------------------------------

Message: 4
Date: Thu, 14 Jul 2005 18:06:43 +0200
From: Martin Eisenberg
Subject: Re: [music-dsp] re: tube saturation algorithm research
To: music-dsp


From: Citizen Chunk

> integState += in - leak * integState;

Scale the input for unity DC response (like Vesa said) and make
time explicit:

integState[n] = leak * in[n] + (1-leak) * integState[n-1]

The highpass is supposed to yield a signal identical to in when
fed with integState, the lowpass output. So relabel in[n] -> out,
integState[n] -> in, integState[n-1] -> diffState in the above.
Isolate out on the left-hand side and add the state update --
voila!

out = 1/leak * (in - (1-leak) * diffState);
diffState = in;

What do you mean when you say the *waveshaper* blows up?


Martin


------------------------------

Message: 6
Date: Thu, 14 Jul 2005 11:47:49 -0700
From: David Lowenfels
Subject: [music-dsp] re: re: re: tube saturation algorithm research
To: music-dsp

Hi Chunk:
   I recommend you start playing with some maths to get the actual  
cutoff frequencies based on the sample rate. Think in terms of pole  
and zero frequencies and transfer functions.. it's worth it to get  
the perspective.

To get a perfect cancellation (well, discounting quantization errors)  
of two filters, just use the inverse.
  H(z) -> 1/H(z)

FYI I think it's also possible that an asymmetrical waveshaper can  
generate a DC offset, though it's probably small.

-D

> hi Vesa. i figured out the the absense of the leak was causing the
> blow up. unfortunately, it also needs a very high leak (~0.999) in
> order for the waveshaper not to blow up. (understandably.) since the
> integrator is thus not doing much integrating, the differentiator
> rolls off all of the low frequency, making it sound horrible. (like a
> HPF with a very high Fc.)
>
> is there some way to manipulate the differentiator to compensate for
> this? is there some sort of "reverse leak" that can, effectively, push
> the differentiator's Fc way down?
>


------------------------------

Message: 8
Date: Fri, 15 Jul 2005 13:09:55 +0200
From: Niko Lange 
Subject: AW: [music-dsp] re: tube saturation algorithm research
To: music-dsp


Hi Antti,
I tried to understand your tube model, but have some difficulty 
undertstanding the  "-> lowpass and feedback to bias" part of the diagram. 
Propably because I am pretty unexperienced in reading such stuff ;-) I 
understand that the output of Ftube() is combined with the voltage source 
V+. First problem, I notice a minus sign there does that mean V+ - Ftube() 
or is it the other way round? Secondly the constant value of V+ seems 
pretty high, does it need to be scaled to be used in floating point Audio? 
Finally is my understanding correct that the resulting signal is multiplied 
by Rk/Rp?
Sorry for asking so many dumb questions...

Niko


------------------------------

Message: 8
Date: Fri, 15 Jul 2005 15:38:57 -0400
From: Citizen Chunk
Subject: [music-dsp] Re: tube saturation algorithm research
To: music-dsp


hi Martin. i already fixed the problem by creating a leak in the
differentiator's feedback. this cancelled out the leak in the
integrator perfectly, also allowing me to keep the leak in the
integrator fairly high (so as to keep it from blowing up).

by "blow up", i mean that it keeps integrating values and does not
even out (as a perfect sinusoid might). this can be controlled with a
leaky integrator, which required a complimentary leak in the
differentiator, so that the differentiator didn't act as an annoying
HPF.

btw, the code that you supplied seems to be for a real 1-pole LPF/HPF,
which is not strictly the same as an integrator/differentiator,
because it scales the input (the zero). i was going on other people's
recommendations of using an "honest-to-goodness"
integrator/differentiator, which, while they are basically just like
1-pole LPF/HPF's, are slightly different.

== chunk



On 7/14/05, Martin Eisenberg wrote:
> From: Citizen Chunk
> 
> > integState += in - leak * integState;
> 
> Scale the input for unity DC response (like Vesa said) and make
> time explicit:
> 
> integState[n] = leak * in[n] + (1-leak) * integState[n-1]
> 
> The highpass is supposed to yield a signal identical to in when
> fed with integState, the lowpass output. So relabel in[n] -> out,
> integState[n] -> in, integState[n-1] -> diffState in the above.
> Isolate out on the left-hand side and add the state update --
> voila!
> 
> out = 1/leak * (in - (1-leak) * diffState);
> diffState = in;
> 
> What do you mean when you say the *waveshaper* blows up?
> 
> 
> Martin
> 
> --
> dupswapdrop -- the music-dsp mailing list and website: 
> subscription info, FAQ, source code archive, list archive, book reviews, dsp
> links 
> http://shoko.calarts.edu/musicdsp 
> http://ceait.calarts.edu/mailman/listinfo/music-dsp
>


------------------------------

Message: 9
Date: Fri, 15 Jul 2005 15:49:03 -0400
From: Citizen Chunk
Subject: [music-dsp] Re: tube saturation algorithm research
To: music-dsp

On 7/14/05, David Lowenfels wrote:
> Hi Chunk:
>    I recommend you start playing with some maths to get the actual  
> cutoff frequencies based on the sample rate. Think in terms of pole  
> and zero frequencies and transfer functions.. it's worth it to get  
> the perspective.

hi David. i thought about using simple 1-pole LPF/HPF, with actual
frequencies to determine the runtime coefficients. however, i decided
in the end just to try playing around with "leaks". it's very easy
because the leak can be the same on both, thereby perfectly cancelling
each other out.

> FYI I think it's also possible that an asymmetrical waveshaper can  
> generate a DC offset, though it's probably small.

sure it can. i can also add one myself. ;)

== chunk


------------------------------

Message: 10
Date: Fri, 15 Jul 2005 23:02:51 +0200
From: Martin Eisenberg
Subject: Re: [music-dsp] Re: tube saturation algorithm research
To: music-dsp

From: Citizen Chunk

> hi Martin. i already fixed the problem by creating a leak in
the
> differentiator's feedback.

I gave you the method because I read you as having accomplished
that by playing around. BTW, there is no feedback there. It's an
FIR.

> btw, the code that you supplied seems to be for a real
> 1-pole LPF/HPF, which is not strictly the same as an
> integrator/differentiator [...]

Yes, one-pole/one-zero. But you yourself are calling 'integrator'
what you know is not a perfect one ;)


Martin



------------------------------

Message: 11
Date: Sat, 16 Jul 2005 00:47:10 +0300
From: Vesa Norilo 
Subject: Re: [music-dsp] Re: tube saturation algorithm research
To: music-dsp 


>hi David. i thought about using simple 1-pole LPF/HPF, with actual
>frequencies to determine the runtime coefficients. however, i decided
>in the end just to try playing around with "leaks". it's very easy
>because the leak can be the same on both, thereby perfectly cancelling
>each other out.
>
>  
>
... but the way your filters influence the waveshaping is now tied to 
the sampling rate. You should, IMHO, calculate the leaky integrator 
based on the sampling rate.

BTW, there's no feedback in the differentiator.

Vesa


----------------------------------------------------------------------

Message: 1
Date: Sat, 16 Jul 2005 00:51:18 +0300
From: Vesa Norilo 
Subject: Re: [music-dsp] Re: tube saturation algorithm research
To: music-dsp 



> ... but the way your filters influence the waveshaping is now tied to 
> the sampling rate. You should, IMHO, calculate the leaky integrator 
> based on the sampling rate.


And my quick and dirty method for doing this is:

Take a standard issue one pole / one zero high pass filter design 
method, tuned to 20Hz or whatnot. Remove the zero altogether.

Reasoning: I want a perfect integrator and a DC-blocker in series. 
Perfect integrator has a pole at 0Hz, DC blocker has a zero at 0Hz. 
Multiplying in freq. domain, these cancel out. What we have left is the 
pole in the DC-blocker. Behold, a leaky integrator results.

Vesa






------------------------------

Message: 2
Date: Fri, 15 Jul 2005 18:14:53 -0400
From: Citizen Chunk
Subject: [music-dsp] Re: tube saturation algorithm research
To: music-dsp 

On 7/15/05, Vesa Norilo wrote:

> ... but the way your filters influence the waveshaping is now tied to 
> the sampling rate. You should, IMHO, calculate the leaky integrator 
> based on the sampling rate.

your absolutely right. i didn't even think of that. thanks for the heads up.

== chunk


------------------------------

Message: 3
Date: Fri, 15 Jul 2005 18:28:21 -0400
From: Citizen Chunk
Subject: [music-dsp] Re: tube saturation algorithm research
To: music-dsp

so, another question: which would be the ideal waveshaping method for
approximating these saturation curves? i've been playing with
Chebyshev polynomials, which is fairly cheap. but is there another,
better way? i found an example of a modified tanh() distortion, using
exp(), which allows asymmetrical waveshaping
(http://www.csounds.com/ezine/winter1999/processing/), but haven't
tried it yet. then there are a bunch of waveshapers in the
musicdsp.org archives. any thoughts?

also... when we talk of the signal's envelope shifting a tube's grid
bias and input DC, can we assume that it only shifts it negatively? in
other words, if one were to feed the envelope back to modulate the
input DC (applied before waveshaping), can we assume that the DC is
always negative, and that the shift only pushes it more negative on
transients? (i'm assuming that even-order waveshaping saturates more
on the negative wave.)

== chunk

On 7/15/05, Citizen Chunk wrote:
> On 7/15/05, Vesa Norilo wrote:
> 
> > ... but the way your filters influence the waveshaping is now tied to 
> > the sampling rate. You should, IMHO, calculate the leaky integrator 
> > based on the sampling rate.
> 
> your absolutely right. i didn't even think of that. thanks for the heads
> up.
> 
> == chunk
>


------------------------------

Message: 6
Date: Sat, 16 Jul 2005 16:00:11 +0200
From: Urs Heckmann
Subject: Re: [music-dsp] Re: tube saturation algorithm research
To: music-dsp

Hi all,

this thread is a really great read!

One idea that comes to my mind, cascaded integrator comb filters (CIC) 
can be used for upsampling and downsampling the signal. I havn't 
thought this through, but maybe it's possible to use multiple stages in 
series to upsample the signal and get the bandlimiting required for the 
waveshaper done in one go.

Dunno exactly how to accomplish this, but it sounds pretty easy to me. 
Maybe it's possible to somehow interleave this process with a series of 
cheap low order waveshapers which in turn add up to the higher order 
required for generation of certain harmonics.

There's a nice pdf on the topic here:

http://www.dspguru.com/info/tutor/cic.htm

Cheers,

;)  Urs


urs heckmann

www.u-he.com



------------------------------

Message: 8
Date: Mon, 18 Jul 2005 10:07:25 +0800
From: dougall
Subject: Re: [music-dsp] re: tube saturation algorithm research
To: music-dsp 

Niko ,
This should translate to something like....

out = lowpass_in ( in * gain )
out = FTube ( out - previous )
previous = lowpass_k(  ( V - out) * Rk/Rp )
out = highpass ( out )

The scaling of input values to a suitable range is done by the gain
value.  More gain will give more drive or distortion.  The paper
quotes a typical gain value of 60 but doesn't give any units.  The
model uses three of these stages in a row, each with different Rk
values, FTube functions and lowpass cutoffs for the filters.  You
would need to scale the final output of the three stages to get it in
a suitable range for playback.  This would be equivalent to the Master
volume in a tube amp.



On 7/15/05, Niko Lange wrote:
> Hi Antti,
> I tried to understand your tube model, but have some difficulty
> undertstanding the  "-> lowpass and feedback to bias" part of the diagram.
> Propably because I am pretty unexperienced in reading such stuff ;-) I
> understand that the output of Ftube() is combined with the voltage source
> V+. First problem, I notice a minus sign there does that mean V+ - Ftube()
> or is it the other way round? Secondly the constant value of V+ seems
> pretty high, does it need to be scaled to be used in floating point Audio?
> Finally is my understanding correct that the resulting signal is multiplied
> by Rk/Rp?
> Sorry for asking so many dumb questions...
> 
> Niko
> 
> -----Ursprungliche Nachricht-----
> Von:
> Gesendet am:    Montag, 11. Juli 2005 20:07
> An:     music-dsp
> Betreff:        Re: [music-dsp] re: tube saturation algorithm research
> 
> On Mon, 11 Jul 2005, David Lowenfels wrote:
> 
> >  I haven't experimented extensively with this, but one way to emulate the
> 
> > above-mentioned transient effect is to use the output of an envelope
> follower
> > (scaled appropriately) as a DC offset to the input of the waveshaper.
> This
> > way you get a transient asymmetry.
> 
> Or you could do it the way the actual circuits work:
> http://www.tml.tkk.fi/~tmakipat/pubs/paper117.pdf
> 
> In short:
> input + bias -> asymmetric waveshaper -> highpass -> output
>                                        -> lowpass and feedback to bias
> 
> I'll see if I can find the polynomial used in building the Ftube()
> waveshaper.
> 
> The model could be improved but already sounds surprisingly good. Next
> version would require better measurements and I don't currently have the
> time to build the custom measurement equipment.
> 
> Beware of the Simulanalog tube model - x^2/3 power law does NOT hold for
> tubes. See http://www.lynx.bc.ca/%7Ejc/model.html
> 
> Antti
> 
> Ps. A tube by itself cannot do anything. It always needs extra circuitry
> around it which has a huge effect on the sound.
> 
> Pps. Anytime you're adding explicit envelope followers or compressors to
> model tube circuitry, you're doing it wrong (unless the unit happens to be
> a compressor). The compression effects of tube amplifiers are due to the
> dynamic shifting of the bias voltage and the low order distortion
> products, not any explicit compressor.
> --
> dupswapdrop -- the music-dsp mailing list and website:
> subscription info, FAQ, source code archive, list archive, book reviews,
> dsp links
> http://shoko.calarts.edu/musicdsp
> http://ceait.calarts.edu/mailman/listinfo/music-dsp
> 
> --
> dupswapdrop -- the music-dsp mailing list and website:
> subscription info, FAQ, source code archive, list archive, book reviews, dsp links
> http://shoko.calarts.edu/musicdsp
> http://ceait.calarts.edu/mailman/listinfo/music-dsp
>



----------------------------------------------------------------------

Message: 1
Date: Mon, 18 Jul 2005 07:14:30 -0400 (EDT)
From: antti
Subject: Re: [music-dsp] re: tube saturation algorithm research
To: music-dsp 

On Mon, 18 Jul 2005, dougall wrote:

> The scaling of input values to a suitable range is done by the gain
> value.  More gain will give more drive or distortion.  The paper
> quotes a typical gain value of 60 but doesn't give any units.  The

Actually Ftube() has typical gain of 60. "gain" parameter ranges from 0 
to 1 (it is just a potentiometer attenuating the voltage). Signal 
amplitude is in volts.

> values, FTube functions and lowpass cutoffs for the filters.  You

Ftube needs to be recalculated every time input resistance is changed 
(technically any time you change the gain parameter of previous stage).

You basically solve
Ig = exp(a*Vg+b) = (Vi-Vg)/Ri
numerically and use the Vg obtained to calculate Vout and store that to 
Vi,Vout table.

a = 6.23 and b = -9.8
I'll need to dig out the polynomial to use for Vout(Vg).

> would need to scale the final output of the three stages to get it in
> a suitable range for playback.  This would be equivalent to the Master
> volume in a tube amp.

Indeed. You will also need very high SNR. The system has gain of 200000 
(65 db!) at full gain.

Antti


------------------------------

Message: 3
Date: Mon, 18 Jul 2005 14:05:04 +0100
From: Max
Subject: Re: [music-dsp] re: tube saturation algorithm research
To: music-dsp

Dougall,

from the original paper it looks like

previous = lowpass_k(  ( V - out) * Rk/Rp )

should be

previous = lowpass_k(  ( -out + bias) * Rk/Rp )

Max

----- Original Message ----- 
From: dougall
To: music-dsp
Sent: Monday, July 18, 2005 3:07 AM
Subject: Re: [music-dsp] re: tube saturation algorithm research


Niko ,
This should translate to something like....

out = lowpass_in ( in * gain )
out = FTube ( out - previous )
previous = lowpass_k(  ( V - out) * Rk/Rp )
out = highpass ( out )

The scaling of input values to a suitable range is done by the gain
value.  More gain will give more drive or distortion.  The paper
quotes a typical gain value of 60 but doesn't give any units.  The
model uses three of these stages in a row, each with different Rk
values, FTube functions and lowpass cutoffs for the filters.  You
would need to scale the final output of the three stages to get it in
a suitable range for playback.  This would be equivalent to the Master
volume in a tube amp.



On 7/15/05, Niko Lange wrote:
> Hi Antti,
> I tried to understand your tube model, but have some difficulty
> undertstanding the  "-> lowpass and feedback to bias" part of the diagram.
> Propably because I am pretty unexperienced in reading such stuff ;-) I
> understand that the output of Ftube() is combined with the voltage source
> V+. First problem, I notice a minus sign there does that mean V+ - Ftube()
> or is it the other way round? Secondly the constant value of V+ seems
> pretty high, does it need to be scaled to be used in floating point Audio?
> Finally is my understanding correct that the resulting signal is 
> multiplied
> by Rk/Rp?
> Sorry for asking so many dumb questions...
>
> Niko
>
> -----Ursprungliche Nachricht-----
> Von:    antti
> Gesendet am:    Montag, 11. Juli 2005 20:07
> An:     music-dsp
> Betreff:        Re: [music-dsp] re: tube saturation algorithm research
>
> On Mon, 11 Jul 2005, David Lowenfels wrote:
>
> >  I haven't experimented extensively with this, but one way to emulate 
> > the
>
> > above-mentioned transient effect is to use the output of an envelope
> follower
> > (scaled appropriately) as a DC offset to the input of the waveshaper.
> This
> > way you get a transient asymmetry.
>
> Or you could do it the way the actual circuits work:
> http://www.tml.tkk.fi/~tmakipat/pubs/paper117.pdf
>
> In short:
> input + bias -> asymmetric waveshaper -> highpass -> output
>                                        -> lowpass and feedback to bias
>
> I'll see if I can find the polynomial used in building the Ftube()
> waveshaper.
>
> The model could be improved but already sounds surprisingly good. Next
> version would require better measurements and I don't currently have the
> time to build the custom measurement equipment.
>
> Beware of the Simulanalog tube model - x^2/3 power law does NOT hold for
> tubes. See http://www.lynx.bc.ca/%7Ejc/model.html
>
> Antti
>
> Ps. A tube by itself cannot do anything. It always needs extra circuitry
> around it which has a huge effect on the sound.
>
> Pps. Anytime you're adding explicit envelope followers or compressors to
> model tube circuitry, you're doing it wrong (unless the unit happens to be
> a compressor). The compression effects of tube amplifiers are due to the
> dynamic shifting of the bias voltage and the low order distortion
> products, not any explicit compressor.
> --
> dupswapdrop -- the music-dsp mailing list and website:
> subscription info, FAQ, source code archive, list archive, book reviews,
> dsp links
> http://shoko.calarts.edu/musicdsp
> http://ceait.calarts.edu/mailman/listinfo/music-dsp
>
> --
> dupswapdrop -- the music-dsp mailing list and website:
> subscription info, FAQ, source code archive, list archive, book reviews, 
> dsp links
> http://shoko.calarts.edu/musicdsp
> http://ceait.calarts.edu/mailman/listinfo/music-dsp
>
--
dupswapdrop -- the music-dsp mailing list and website:
subscription info, FAQ, source code archive, list archive, book reviews, dsp 
links
http://shoko.calarts.edu/musicdsp
http://ceait.calarts.edu/mailman/listinfo/music-dsp 



------------------------------

Message: 4
Date: Mon, 18 Jul 2005 18:33:08 +0100
From: Rob Belcham
Subject: RE: [music-dsp] Re: tube saturation algorithm research
To: music-dsp

Wow, Thanks Urs, great link. I've never heard of CIC filters before, i've
been using IIR allpass half-band filters for my up/down sampling tasks,
courtesy of the music-dsp archive :)

Shame there's no frequency response graphs in the paper, i'll have to have a
bit of a matlab session at work tomorrow to get to grips with these filters.

What does the frequency response actually look like ? How much attenuation
in the stopband, how much of the pass-band is 'useable' ?

I can't get my head around how they work though, with all those integrators
in series, don't the taps go off to infinity & become unstable ? The paper
doesn't mention using 'leaky' integrators. How bizzare!

Rob




> -----Original Message-----
> From: music-dsp-bounces
> On Behalf Of Urs Heckmann
> Sent: 16 July 2005 15:00
> To: music-dsp
> Subject: Re: [music-dsp] Re: tube saturation algorithm research
>
>
> Hi all,
>
> this thread is a really great read!
>
> One idea that comes to my mind, cascaded integrator comb filters (CIC)
> can be used for upsampling and downsampling the signal. I havn't
> thought this through, but maybe it's possible to use multiple stages in
> series to upsample the signal and get the bandlimiting required for the
> waveshaper done in one go.
>
> Dunno exactly how to accomplish this, but it sounds pretty easy to me.
> Maybe it's possible to somehow interleave this process with a series of
> cheap low order waveshapers which in turn add up to the higher order
> required for generation of certain harmonics.
>
> There's a nice pdf on the topic here:
>
> http://www.dspguru.com/info/tutor/cic.htm
>
> Cheers,
>
> ;)  Urs
>
>
> urs heckmann
> www.u-he.com
>
> --
> dupswapdrop -- the music-dsp mailing list and website:
> subscription info, FAQ, source code archive, list archive, book
> reviews, dsp links
> http://shoko.calarts.edu/musicdsp
> http://ceait.calarts.edu/mailman/listinfo/music-dsp
>



------------------------------

Message: 5
Date: Mon, 18 Jul 2005 19:48:54 +0200
From: Niko Lange
Subject: Re: [music-dsp] re: tube saturation algorithm research
To: music-dsp


Thanks for the helpful explanations Dougall and Antti! I alrady played
around with it a little at the weekend but misread some of the info in the
diagram. I'll see if I can get it to work.

cheers,

Niko

----- Original Message ----- 
From: antti
To: music-dsp
Sent: Monday, July 18, 2005 1:14 PM
Subject: Re: [music-dsp] re: tube saturation algorithm research


> On Mon, 18 Jul 2005, dougall wrote:
>
> > The scaling of input values to a suitable range is done by the gain
> > value.  More gain will give more drive or distortion.  The paper
> > quotes a typical gain value of 60 but doesn't give any units.  The
>
> Actually Ftube() has typical gain of 60. "gain" parameter ranges from 0
> to 1 (it is just a potentiometer attenuating the voltage). Signal
> amplitude is in volts.
>
> > values, FTube functions and lowpass cutoffs for the filters.  You
>
> Ftube needs to be recalculated every time input resistance is changed
> (technically any time you change the gain parameter of previous stage).
>
> You basically solve
> Ig = exp(a*Vg+b) = (Vi-Vg)/Ri
> numerically and use the Vg obtained to calculate Vout and store that to
> Vi,Vout table.
>
> a = 6.23 and b = -9.8
> I'll need to dig out the polynomial to use for Vout(Vg).
>
> > would need to scale the final output of the three stages to get it in
> > a suitable range for playback.  This would be equivalent to the Master
> > volume in a tube amp.
>
> Indeed. You will also need very high SNR. The system has gain of 200000
> (65 db!) at full gain.
>
> Antti
> --
> dupswapdrop -- the music-dsp mailing list and website:
> subscription info, FAQ, source code archive, list archive, book reviews,
dsp links
> http://shoko.calarts.edu/musicdsp
> http://ceait.calarts.edu/mailman/listinfo/music-dsp
>



------------------------------

Message: 6
Date: Mon, 18 Jul 2005 19:07:33 +0100
From: Rob Belcham
Subject: [music-dsp] CIC Filters. Was : tube saturation algorithm
	research
To: music-dsp


Found a really well written article explaining CIC filters if anyone's
interested..

http://www.phptr.com/articles/article.asp?p=361985&seqNum=1

Rob




----------------------

------------------------------

Message: 8
Date: Mon, 18 Jul 2005 20:10:02 +0200
From: Urs Heckmann
Subject: Re: [music-dsp] Re: tube saturation algorithm research
To: music-dsp

Hey Rob,

yeah, they're quite bizarre.

I think that these have mostly found usage in fixed point arithmetic 
where avoiding multiplication was crucial, as there is *no* 
multiplication in there. Otherwise I think they perform pretty weak in 
respect of bandlimiting (somebody told me, can't remember who it was). 
I wouldn't be surprised if their outcome is pretty much close to linear 
interpolation.

Sorry for the unqualified guess, I have successfully avoided 
up/downsampling throughout my young dsp career. Made several attempts 
but always found a way to circumvent the need (like, doublesampling 
sounded good enough etc.)

However, it'd indeed be cool to know what exactly they do. If they 
perform reasonably decent, they might be a cheap way to improve methods 
like double sampling.

Cheers,

;)  Urs


Am 18.07.2005 um 19:33 schrieb Rob Belcham:

> Wow, Thanks Urs, great link. I've never heard of CIC filters before, 
> i've
> been using IIR allpass half-band filters for my up/down sampling tasks,
> courtesy of the music-dsp archive :)
>
> Shame there's no frequency response graphs in the paper, i'll have to 
> have a
> bit of a matlab session at work tomorrow to get to grips with these 
> filters.
>
> What does the frequency response actually look like ? How much 
> attenuation
> in the stopband, how much of the pass-band is 'useable' ?
>
> I can't get my head around how they work though, with all those 
> integrators
> in series, don't the taps go off to infinity & become unstable ? The 
> paper
> doesn't mention using 'leaky' integrators. How bizzare!



------------------------------

Message: 9
Date: Mon, 18 Jul 2005 19:25:27 +0100
From: Rob Belcham
Subject: RE: [music-dsp] Re: tube saturation algorithm research
To: music-dsp

Answering my own questions..

> Shame there's no frequency response graphs in the paper, i'll
> have to have a
> bit of a matlab session at work tomorrow to get to grips with
> these filters.

Matlab wont be able to run these filters without the fixed point blockset,
becuase the structure has to use fixed point maths, as it relies on
calculations involving overflowing accumulators.

> What does the frequency response actually look like ? How much attenuation
> in the stopband, how much of the pass-band is 'useable' ?
The frequency response looks like a rectified sinc function, the attenuation
depends on the number of stages. There's not much usable passband, although
FIR filters can be used to equalize the response.

> I can't get my head around how they work..
They work becuase of the use of overflowing accumulators (see the link in my
previous mail to see how this works. They seem ideal for FPGA implementation
because there are no multiplies, but i'm not sure how big an accumulator you
would need to be able to run on 24 bit audio on something like a SHARC DSP.

Interesting filter structure though.

Rob
前の記事へ | 次の記事へ | 戻る