JP2004129072A - Sampling frequency conversion device and sampling frequency conversion method - Google Patents

Sampling frequency conversion device and sampling frequency conversion method Download PDF

Info

Publication number
JP2004129072A
JP2004129072A JP2002292860A JP2002292860A JP2004129072A JP 2004129072 A JP2004129072 A JP 2004129072A JP 2002292860 A JP2002292860 A JP 2002292860A JP 2002292860 A JP2002292860 A JP 2002292860A JP 2004129072 A JP2004129072 A JP 2004129072A
Authority
JP
Japan
Prior art keywords
sampling frequency
signal
output
calculating
time position
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Withdrawn
Application number
JP2002292860A
Other languages
Japanese (ja)
Inventor
Koichi Hasegawa
長谷川 浩一
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Sony Corp
Original Assignee
Sony Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Sony Corp filed Critical Sony Corp
Priority to JP2002292860A priority Critical patent/JP2004129072A/en
Publication of JP2004129072A publication Critical patent/JP2004129072A/en
Withdrawn legal-status Critical Current

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To easily convert a conversion rate of a sampling frequency with a simplified structure. <P>SOLUTION: On the basis of a sampling frequency Fs<SB>1</SB>of an input signal and a sampling frequency Fs<SB>2</SB>of an output signal there are calculated a ratio R of Fs<SB>1</SB>with respect to Fs<SB>2</SB>, a maximum exponent R<SB>1</SB>of 2 not exceeding R, a ratio R<SB>2</SB>of R with respect to R<SB>1</SB>, and R<SB>3</SB>satisfying R<SB>2</SB>≈R<SB>3</SB>/N and an exponent T of 2, and the input signal is converted to an average signal comprising an average value for every R<SB>1</SB>samples, and thereafter a time position P with T taken as a period is calculated. The time position P is increased for every R3/2, and a linear interpolation on the basis of the time position P is performed for every change of the time position P. <P>COPYRIGHT: (C)2004,JPO

Description

【0001】
【発明の属する技術分野】
本発明は、サンプリングされた時系列信号のサンプリング周波数を再サンプリングするサンプリング周波数変換装置およびサンプリング周波数変換方法に関する。
【0002】
【従来の技術】
近年、デジタル音声信号のサンプリング(標本化)周波数は、例えば、デジタルビデオの32kHz、コンパクトディスクの44.1kHz、DVD−Audioの96kHz等数多くのサンプリング周波数が混在している。
【0003】
従って、符号化装置へ与えるデジタル音声信号、復号化装置から得られるデジタル音声信号、復号化装置から得られるデジタル音声信号のサンプリング周波数は装置間で必ずしも一致しない。そのため、電子機器を相互接続する際には、サンプリング周波数を再変換する必要がある。
【0004】
一般に、サンプリング周波数の変換は、補間と再サンプリングに分類される。補間は離散信号データから新しく連続関数を作成する処理であり、再サンプリングは連続関数から新しい離散信号データを作成する処理である。離散信号データから連続関数を作成するには、離散信号データと補間カーネルの一次結合、すなわち畳込みを行う。
【0005】
【発明が解決しようとする課題】
従来、サンプリング周波数を変換する方法として、フィルタバンクを用いた方法がある。この方法では、出力信号のサンプリング周波数と入力信号のサンプリング周波数との最小公倍数を求め、入力信号を最小公倍数でアップサンプリングし、それを低域通過フィルタで補間し、出力信号のサンプリング周波数にダウンサンプリングする。
【0006】
出力信号のサンプリング周波数が入力信号のサンプリング周波数より低い場合、ダウンサンプリングの前にフィルタリングを行う必要があり、サンプリング周波数変換装置の処理負担が大きくなる。
【0007】
一方、出力信号のサンプリング周波数が入力信号のサンプリング周波数より高い場合、アップサンプリングの前にフィルタリングを行う必要があり、サンプリング周波数変換装置の処理負担が大きくなる。
【0008】
以上のように、フィルタバンクを用いてサンプリング周波数の変換を行うと、サンプリング周波数変換装置の処理負担が大きくなる。そのため、回路規模を大きく、動作速度を速くする必要がある。
【0009】
また、フィルタバンクを使用した方法では、入力信号のサンプリング周波数や出力信号のサンプリング周波数が変更されるごとにフィルタの再設計が必要となる。フィルタの係数の算出においては、チェス盤歪み等に注意して設計しなければならず、複雑にして多くの処理が必要である。複雑なフィルタは、入出力の遅延時間が大きく、装置全体の応答特性を悪化させることになる。
【0010】
本発明は、上記の課題に鑑みてなされたものであって、簡単な回路構成であり、かつ、入力信号のサンプリング周波数および出力信号のサンプリング周波数の変更が容易なサンプリング周波数変換装置およびサンプリング周波数変換方法を提供することを目的とする。
【0011】
【課題を解決するための手段】
上記の課題を解決するため、本発明におけるサンプリング周波数変換装置は、第1のサンプリング周波数でサンプリングされた信号を入力し第2のサンプリング周波数でサンプリングされた信号に変換して出力するサンプリング周波数変換装置であって、第1のサンプリング周波数の第2のサンプリング周波数に対する比(Rとする。)を算出する入出力周波数比算出手段と、Rを超えない最大の2の巾数(Rとする。)を算出する巾数算出手段と、Rに対するRの比(Rとする。)を算出する巾数比算出手段と、Rを任意の整数Rと2の巾数Nの逆数とで表される関数で置換する置換手段と、第1のサンプリング周波数でサンプリングされた信号から時系列に連なるR個の信号値を抽出し、このR個の信号値ごとに一平均値を算出し、この平均値を平均信号として出力する平均信号算出手段と、第2の巾乗を上記平均信号のサンプリング周期とし、入力信号のサンプリング点に対する出力信号のサンプリング点の相対的な時間位置を算出する時間位置算出手段と、平均信号を算出された時間位置で直線補間し、補間して得た値を出力信号とする。
【0012】
また、本発明におけるサンプリング周波数変更方法は、第1のサンプリング周波数でサンプリングされた信号を入力し第2のサンプリング周波数でサンプリングされた信号に変換して出力するサンプリング周波数変換方法であって、第1のサンプリング周波数の第2のサンプリング周波数に対する比(Rとする。)を算出する入出力周波数比算出工程と、Rを超えない最大の2の巾数(Rとする。)を算出する巾数算出工程と、Rに対するRの比(Rとする。)を算出する巾数比算出工程と、Rを任意の整数Rと2の巾数Nの逆数とで表される関数で置換する置換工程と、第1のサンプリング周波数でサンプリングされた信号から時系列に連なるR個の信号値を抽出し、このRの信号値ごとに一平均値を算出し、この平均値を平均信号として出力する平均信号算出工程と、第2の巾乗を平均信号のサンプリング周期とし、入力信号のサンプリング点に対する出力信号のサンプリング点の相対的な時間位置を算出する時間位置算出工程と、平均信号を算出された時間位置で直線補間し、補間して得た値を上記出力信号とする。
【0013】
【発明の実施の形態】
以下、本発明を適用したサンプリング周波数変換装置について説明する。サンプリング周波数変換装置は、主に、4つの処理を行うことによって、サンプリング周波数を変換する。第1の処理は、入力信号のサンプリング周波数Fsと出力信号のサンプリング周波数Fsの値に基づいて、定数R、R、R、R、N、Tを算出する処理である。この処理は、フローチャートのステップS1およびステップS2に対応する。ここで、定数Rとは入力信号のサンプリング周波数Fsの出力信号のサンプリング周波数Fsに対する比であり、RはRを2の巾数で近似した値であり、RはRとRの誤差を示す値であり、RおよびNはRを整数および2の巾数で近似する際に使用する値であり、Tは直線補間におけるサンプル間の周期を示す値である。
【0014】
以下、サンプリング周波数変換装置1が実行する4つの処理について図1のフローチャートに従って説明する。サンプリング周波数変換装置1は、入力信号のサンプリング信号Fsと出力信号のサンプリング周波数Fsの変化を常に監視し、Fsおよび/またはFsが変化すると(ステップS1;YES)、ステップS2に処理を移行し、定数R、R、R、R、N、Tを更新する(ステップS2)。
【0015】
ステップS2において、サンプリング周波数変換装置1が定数R、R、R、R、Tを算出する手順は、以下のようになる。サンプリング周波数変換装置1は、まず、定数Rを算出する。定数Rは、入力信号のサンプリング周波数Fsと出力信号のサンプリング周波数Fsとの比であるから、以下の式(1)で求められる。
R=Fs/Fs・・・(1)
【0016】
次に、サンプリング周波数変換装置1は、定数Rを算出する。定数Rは、以下の式(2)で求められる値である。
=pow(2,floor(log2(max(1,R)))・・・(2)
ただし、pow(x,y)は、xのy乗を返す関数
floor(x)は、xを超えない最大の整数値を返す関数
log2(x)は、xの2を底としたときの対数
max(x,y)は、xとyのうちの大きい方の値を返す関数
である。
【0017】
式(2)によって算出されたRは、入力信号をダウンサンプリングする場合とアップサンプリングする場合とで異なる値をとる。ダウンサンプリングする場合のRとアップサンプリングする場合のRとの演算結果の違いを説明する。
【0018】
ダウンサンプリングする場合、Fs>Fsであるから、R>1となる。このとき、max(1,R)の戻り値はRとなり、Rの値はRを超えない最大の2の巾数となる。ダウンサンプリングする場合、定数Rは、入力信号の平均値をとるためのサンプル数として使用される。R個のサンプルから1つの平均値を求めると、入力信号のサンプリング周波数Fsは、Fs×(1/R)に変換される。以下、R個のサンプルごとに平均化された信号を平均信号と記す。
【0019】
一方、アップサンプリングする場合、Fs<Fsであり、R<1となる。max(1,R)の戻り値は1となり、Rの値は1となる。
【0020】
信号をアップサンプリングする場合、Rの値は1である。1つのサンプルの平均値を求めても、サンプルの値およびサンプルの個数は変化しない。そのため、入力信号はそのまま出力され、入力信号のサンプリング周波数Fsも変化しない。
【0021】
ステップS2では、さらに、サンプリング周波数変換装置1は、R2を算出する。R2は、以下の式(3)で求められる値である。
=R/R・・・(3)
【0022】
は、平均信号のサンプリング周波数Fs×(1/R)をFsに変換するための定数として使用される。Rの意味を数式を使って説明する。なお、以下の式において、平均信号のサンプリング周波数をFsMeanで表現する。

Figure 2004129072
【0023】
このように、平均信号のサンプリング周波数を1/R倍すると、出力信号のサンプリング周波数Fsを求めることができる。しかしながら、Rは、整数と整数との除数であるため、値が小数になり、ハードウェアで演算を実行する際、回路規模が大きくなるという問題がある。そこで、Rを整数Rと2の巾数との組み合わせで表現する。
【0024】
=R/pow(2,N)+Re・・・(4)
式(4)において、R、Nは、Re≒0となるような整数である。式(4)において、Re=0と仮定すると、R=R/pow(2,N)となる。サンプリング周波数変換装置1では、平均信号のサンプルの個数をpow(2,N)/R3倍することにより、平均信号のサンプリング周波数をFsに変換できる。
【0025】
サンプリング周波数変換装置1は、平均信号のサンプリング周波数をpow(2,N)/R倍するために、直線補間を用いる。サンプリング周波数変換装置1は、直線補間に使用される定数として、周期を算出する。周期Tは以下の式(5)に基づいて算出される。なお、直線補間の手順については、後述する。
T=pow(2,N)・・・(5)
【0026】
以上のように、定数R、R、R、R、N、Tが算出される。なお、ステップS1において、FsおよびFsの値が変化しない場合には(ステップS1;NO)、サンプリング周波数変換装置1は、定数R、R、R、R、N、Tの値を更新することなく、ステップS3に処理を移行する。
【0027】
次いで、サンプリング周波数変換装置1は、第2の処理および第3の処理を開始する。第2の処理は、信号の直線補間を行う処理である。第2の処理は、主に、図1のフローチャートのステップS4、ステップS5、ステップS10、ステップS11に対応する。サンプリング周波数変換装置1はステップS4、ステップS5において、1回目の直線補間を行い、ステップS10、ステップS11において、2回目の直線補間を行う。サンプリング周波数変換装置1が2回の直線補間を行うのは、直線補間の結果を平均するためであり、これにより、信号のイメージノイズが取り除かれる。
【0028】
また、第3の処理は、入力信号をR1個のサンプルごとに平均をとり、平均信号を生成する処理である。第3の処理は、フローチャートのステップS8、ステップS14に対応する。
【0029】
サンプリング周波数変換装置1が第2の処理として行う直線補間の手順を図2を参照して説明する。図2は、周期Mと、平均信号と、出力信号との関係を示す図である。平均信号は、入力信号をR個のサンプルごとに平均化した信号である。図2は、縦軸を振幅、横軸を時間とするグラフである。図2における、黒丸は平均信号の値を示し、黒四角は出力信号を示している。この図において、I〜Iの平均信号が時系列に入力されている。平均信号のサンプリング周期はTに設定されている。ここで、平均信号の周期を信号の入力された順にT、T、Tと表す。
【0030】
まず、時間位置Pが周期Tに存在するとき、サンプリング周波数変換装置1は、Iの値を記憶領域Bに記憶し、Iの値を記憶領域Bに記憶する。そして、B、B、T、Pの値を式(6)に代入し、時間位置Pにおける直線補間Sを算出する。
【0031】
=B×(T−P)+B×P・・・(6)
【0032】
ステップS4において、直線補間を完了すると、サンプリング周波数変換装置1は、現在のPの値を式(7)に代入し、Pの値を更新する。
P=P+R/2・・・(7)
そして、Pの値がTより大きくなると(ステップS6;YES)、ステップS7に処理を移行する。また、Pの値がTを超えない場合には(ステップS6;NO)、サンプリング周波数変換装置1は、処理をステップS10に移行する。
【0033】
ステップS6において、Pの値がTより大きくなった場合、Pの時間位置は周期Tに移動する。サンプリング周波数変換装置1は、周期Tでの直線補間を実行するために、B、Bに記憶された値を変更する。Tの左端の値は、Tの右端の値である。そこで、サンプリング周波数変換装置1は、式(8)を用いて、周期TにおけるBの値を記憶領域Bに代入し、記憶の時間的移動を行う。(ステップS7)。
=B・・・(8)
【0034】
周期TにおけるBの値が設定されると、サンプリング周波数変換装置1は、周期TにおけるBの値を算出する(ステップS8)。周期TにおけるBは、R個の入力信号の平均値であり、式(9)をもとに算出することができる。
=(I[t+0]+I[t+1]+・・・+I[t+R])/R・・・(9)
ここで、I[t]は、入力時刻tにおける入力信号と表すため、I[t]に次いで入力される入力信号は、時系列を持って、I[t+0],I[t+1],・・・,I[t+n]となる。
【0035】
ステップS8が終了すると、サンプリング周波数変換装置1は、Pの値からMの値を引き、Pの値が0以上M未満の整数となるように調整する(ステップS9)。式(10)は、Pの値を調整するための式である。図2に示すように、式(10)よって算出されたPの値は、周期Tの時間位置を示している。
P=P−M・・・(10)
【0036】
次いで、サンプリング周波数変換装置1は、2回目の直線補間を行う(ステップS11)。2回目の直線補間は、1回目の直線補間と同様に実行される。ステップS11では、1回目の直線補間の結果と2回目の直線補間の結果との和をBとして出力するため、演算式は式(11)のように表現される。
=B+B×(M−P)+B×P・・・(11)
【0037】
2回目の直線補間が終了すると、サンプリング周波数変換装置1は、式(6)に従って、Pの値を算出し(ステップS11)、Pの値がTより大きい場合には(ステップS12;YES)、記憶領域Bに記憶された値を記憶領域Bに記憶させるとともに(ステップS13)、新しいBの算出を行う(ステップS14)。新しいBを算出すると、サンプリング周波数変換装置1は、Pの値からMの値を引いてPの値を調整する(ステップS15)。これらの処理によって、B、B、Pの値が算出され、次の直線補間が実行できるようになる。なお、ステップS11〜ステップS15までの処理は、それぞれステップS5〜ステップS9までの処理と同様であるため、詳しい説明を省略する。
【0038】
次いで、サンプリング周波数変換装置1は、ステップS16に処理を移行し、第4の処理を実行する。第4の処理は、1回目の直線補間と2回目の直線補間の平均をとり、出力信号Oを算出する処理である。1回目の直線補間と2回目の直線補間の平均をとる演算は、以下の式(12)のように表される。
O=B/(M×2)・・・(12)
は、1回目の直線補間と2回目の直線補間との和であるため、Bを2で割るだけで直線補間の平均は算出される。式(12)おいて、BをM×2で割っているのは、式(7)の直線補間を算出する演算において、式全体をMで割る演算を省略しているためである。M×2は2のべき乗であるため、式(12)の演算は、簡単なビット演算で実行することができる。ステップS16の処理が完了すると、サンプリング周波数変換装置1は、ステップS16で算出した値を出力信号として出力する(ステップS17)。
【0039】
以下、上述の処理を実行するサンプリング周波数変換装置1の一例について説明する。図3はサンプリング周波数変換装置1の回路構成を示す図である。サンプリング周波数変換装置1の回路は、その処理ごとに4つのブロックに分類される。
【0040】
図3において、加算器19と、DQフリップフロップ20と、除算器21と、セレクタ23とは、入力信号の平均値を算出するブロックである。また、乗算器24と、乗算器25と、減算器26と、加算器27とは、直線補間を行うためのブロックである。また、加算器32と、DQフリップフロップ31と、セレクタ34と、除算器30とは、直線補間の平均をとるブロックである。DQフリップフロップ28と、加算器33とは、時間位置Pの算出を行うブロックである。また、マイクロプロセッサ35は、R、R、R、R、T、Nの算出を行い、シーケンサ36は、セレクタの入力信号の制御を行う。
【0041】
まず、入力信号の平均値を算出する回路について説明する。入力端子18から信号が入力されると、入力された信号は加算器19に入力される。加算器19には、入力信号のほかにセレクタ23からの信号が入力される。シーケンサ36は、加算器19の加算回数がRに達するまでセレクタ23のスイッチをAに設定する。スイッチがAに設定されている間、加算器19には、DQフリップフロップ20に蓄積された信号が出力される。加算器19は、入力信号とDQフリップフロップ20に蓄積された信号とを加算し、この値をDQフリップフロップ20に蓄積する。シーケンサ36は、加算器19の加算数がRに達すると、セレクタ23のスイッチをBに設定し、DQフリップフロップ20の値をリセットする。そして、DQフリップフロップ20に累積加算された値は、除算器21に出力される。除算器21は、入力された信号をRで除算する。除算器21からの出力は、R個のサンプルの平均値になる。
【0042】
次に、除算器21から出力された値は、DQフリップフロップ22および乗算器24に出力される。DQフリップフロップ22に出力された値は、1サンプル遅延するため、上述の処理フローにおいてのBに相当し、乗算器21に出力された値は遅延がないため、上述の処理フローにおけるBに相当する。乗算器24には、DQフリップフロップ28に格納されたPの値が出力され、乗算器24では、入力信号の平均値とPとの積「B×P」が算出される。
【0043】
また、減算器26において、DQフリップフロップ28から出力されたPの値とMとの差分「T−P」が算出され、この値は、乗算器25に出力される。乗算器25では、減算器26からの出力「T−P」と入力信号の平均値との積「B×(T−P)」が求められる。加算器27では、乗算器24からの出力「B×P」と乗算器25からの出力「B×(T−P)」との和「B×(T−P)+B×P」を算出する。これにより、直線補間される。
【0044】
加算器27によって算出された直線補間の結果は、加算器32に出力される。加算器32には、セレクタ34からの出力が入力される。シーケンサ36は、加算器32の加算回数が2回になるまで、セレクタのスイッチをAにする。スイッチがAに設定されている間、加算器32にはDQフリップフロップ31に蓄積された値が出力される。そのため、加算器32は、加算器27からの出力とDQフリップフロップ31に蓄積された値とを加算し、この結果をDQフリップフロップ31に蓄積していく。そして、加算器32の加算回数が2回になると、シーケンサ36は、セレクタ34のスイッチをBに切り換え、DQフリップフロップ31の値をリセットするとともに、DQフリップフロップ31に蓄積されていた値を除算器30に出力する。
【0045】
除算器30は、DQフリップフロップ31から出力された値をT×2で除算し、直線補間の結果の平均値を算出する。除算器30によって算出された値は、出力信号として、出力端子29を介して外部に出力される。
【0046】
以上のように、サンプリング周波数変換装置1は、入力信号のサンプリング周波数をR分の1に変換した後、直線補間を用いて目的のサンプリング周波数に変換する。また、アップサンプリングする場合、サンプリング周波数変換装置1は、直線補間のみを用いて目的のサンプリング周波数に変換する。
【0047】
サンプリング周波数変換装置1は、R個のサンプルの相加平均を出力信号とすることにより、入力信号のサンプリング周波数をR分の1に変換する。Rサンプルの和を求める演算と、サンプルの和をRで割る演算とは、単純な回路で実現できる。
【0048】
また、サンプリング周波数変換装置1は、サンプルの出現する周期をTに設定し、この周期Tに対する時間位置Pをもとに直線補間を行う。時間位置Pの変位量R/2であり、直線補間はR/2Tの割合で実行される。R、Pは整数であり、Tは2の巾数であるため、直線補間は2の巾数と整数との四則演算により算出される。このため、直線補間は、単純な回路で実現できる。
【0049】
また、サンプリング周波数変換装置1は、信号のサンプリング周波数を2×Fsに変換し、変換した信号の2サンプルずつの平均を出力信号として出力する。この処理は、信号に含まれるイメージノイズを除去するために実行される。イメージノイズを回路で除去しようとすると、大きな回路が必要になる。本発明を適用したサンプリング周波数変換装置1は、加算器と記憶素子と乗算器のみでイメージノイズが除去できるため、ハードウェア構成が単純になる。
【0050】
また、サンプリング周波数変換装置1は、定数R、R、R、T、Nの値をセレクタに入力して、サンプリング周波数の変換レートを制御している。そのため、入力信号のサンプリング周波数Fsと出力信号のサンプリング周波数Fsの変化に応じて定数R、R、R、T、Nを再計算するだけで、サンプリング周波数の変化に対応することができる。
【0051】
【発明の効果】
上記の課題を解決するため、本発明におけるサンプリング周波数変換装置は、第1のサンプリング周波数でサンプリングされた信号を入力し第2のサンプリング周波数でサンプリングされた信号に変換して出力するサンプリング周波数変換装置であって、第1のサンプリング周波数の第2のサンプリング周波数に対する比(Rとする。)を算出する入出力周波数比算出手段と、Rを超えない最大の2の巾数(Rとする。)を算出する巾数算出手段と、Rに対するRの比(Rとする。)を算出する巾数比算出手段と、Rを任意の整数Rと2の巾数Nの逆数とで表される関数で置換する置換手段と、第1のサンプリング周波数でサンプリングされた信号から時系列に連なるR個の信号値を抽出し、このR個の信号値ごとに一平均値を算出し、この平均値を平均信号として出力する平均信号算出手段と、第2の巾乗を上記平均信号のサンプリング周期とし、入力信号のサンプリング点に対する出力信号のサンプリング点の相対的な時間位置を算出する時間位置算出手段と、平均信号を算出された時間位置で直線補間し、補間して得た値を出力信号とする。そのため、回路構成が簡単であるだけではなく、入力信号のサンプリング周波数および出力信号のサンプリング周波数の変更が容易なサンプリング周波数変換装置を提供することができる。
【0052】
また、本発明におけるサンプリング周波数変更方法は、第1のサンプリング周波数でサンプリングされた信号を入力し第2のサンプリング周波数でサンプリングされた信号に変換して出力するサンプリング周波数変換方法であって、第1のサンプリング周波数の第2のサンプリング周波数に対する比(Rとする。)を算出する入出力周波数比算出工程と、Rを超えない最大の2の巾数(Rとする。)を算出する巾数算出工程と、Rに対するRの比(Rとする。)を算出する巾数比算出工程と、Rを任意の整数Rと2の巾数Nの逆数とで表される関数で置換する置換工程と、第1のサンプリング周波数でサンプリングされた信号から時系列に連なるR個の信号値を抽出し、このRの信号値ごとに一平均値を算出し、この平均値を平均信号として出力する平均信号算出工程と、第2の巾乗を平均信号のサンプリング周期とし、入力信号のサンプリング点に対する出力信号のサンプリング点の相対的な時間位置を算出する時間位置算出工程と、平均信号を算出された時間位置で直線補間し、補間して得た値を上記出力信号とする。そのため、この方法をサンプリング周波数変換装置に適用すると、サンプリング周波数変換装置の回路構成を簡単にするとともに、入力信号のサンプリング周波数および出力信号のサンプリング周波数を容易に変化させることができる。
【図面の簡単な説明】
【図1】サンプリング周波数を変換する手順を示すフローチャートである。
【図2】直線補間の手順を示す図である。
【図3】サンプリング周波数変換装置の回路構成を示す図である。
【符号の説明】
1 サンプリング周波数変換装置、18 入力端子、19 加算器、20 DQフリップフロップ、21 除算器、22 DQフリップフロップ、23 セレクタ、24 乗算器、25 乗算器、26 減算器、27 加算器、28 DQフリップフロップ、29 出力端子、30 除算器、31 DQフリップフロップ、32 加算器、33 加算器、34 セレクタ[0001]
TECHNICAL FIELD OF THE INVENTION
The present invention relates to a sampling frequency conversion device and a sampling frequency conversion method for resampling a sampling frequency of a sampled time-series signal.
[0002]
[Prior art]
In recent years, the sampling frequency of digital audio signals has been mixed with a large number of sampling frequencies such as 32 kHz for digital video, 44.1 kHz for compact discs, and 96 kHz for DVD-Audio.
[0003]
Therefore, the sampling frequencies of the digital audio signal supplied to the encoding device, the digital audio signal obtained from the decoding device, and the digital audio signal obtained from the decoding device do not always match between the devices. Therefore, when interconnecting electronic devices, it is necessary to reconvert the sampling frequency.
[0004]
Generally, the conversion of the sampling frequency is classified into interpolation and resampling. Interpolation is a process of creating a new continuous function from discrete signal data, and resampling is a process of creating new discrete signal data from a continuous function. In order to create a continuous function from the discrete signal data, a linear combination of the discrete signal data and the interpolation kernel, that is, convolution is performed.
[0005]
[Problems to be solved by the invention]
Conventionally, as a method of converting a sampling frequency, there is a method using a filter bank. In this method, the least common multiple of the sampling frequency of the output signal and the sampling frequency of the input signal is obtained, the input signal is upsampled by the least common multiple, interpolated by a low-pass filter, and downsampled to the sampling frequency of the output signal. I do.
[0006]
If the sampling frequency of the output signal is lower than the sampling frequency of the input signal, it is necessary to perform filtering before downsampling, and the processing load on the sampling frequency conversion device increases.
[0007]
On the other hand, if the sampling frequency of the output signal is higher than the sampling frequency of the input signal, it is necessary to perform filtering before upsampling, and the processing load on the sampling frequency converter increases.
[0008]
As described above, when the sampling frequency is converted using the filter bank, the processing load of the sampling frequency conversion device increases. Therefore, it is necessary to increase the circuit scale and the operating speed.
[0009]
Further, in the method using the filter bank, it is necessary to redesign the filter every time the sampling frequency of the input signal or the sampling frequency of the output signal is changed. In calculating the coefficients of the filter, the design must be made with careful attention to chessboard distortion and the like, which is complicated and requires many processes. A complicated filter has a large input / output delay time, which deteriorates the response characteristics of the entire device.
[0010]
The present invention has been made in view of the above problems, and has a simple circuit configuration, and a sampling frequency conversion device and a sampling frequency conversion that can easily change the sampling frequency of an input signal and the sampling frequency of an output signal. The aim is to provide a method.
[0011]
[Means for Solving the Problems]
In order to solve the above problem, a sampling frequency conversion device according to the present invention is provided with a sampling frequency conversion device that inputs a signal sampled at a first sampling frequency, converts the signal into a signal sampled at a second sampling frequency, and outputs the converted signal. Input / output frequency ratio calculating means for calculating a ratio (R) of the first sampling frequency to the second sampling frequency, and a maximum width of 2 (R 1 And ) Is calculated, and R 1 To the ratio of R to (R 2 And ) For calculating the width ratio ratio; 2 Is any integer R 3 And a replacement means for performing replacement by a function represented by a function represented by a reciprocal of the width N of 2 and a signal R sampled at the first sampling frequency. 1 Signal values are extracted, and this R 1 Average signal calculation means for calculating an average value for each of the signal values, and outputting the average value as an average signal; an output signal for a sampling point of the input signal, wherein the second power is used as a sampling period of the average signal. And a time position calculating means for calculating a relative time position of the sampling point, and linearly interpolating the average signal at the calculated time position, and use the value obtained by the interpolation as an output signal.
[0012]
Further, the sampling frequency changing method according to the present invention is a sampling frequency conversion method for inputting a signal sampled at a first sampling frequency, converting the signal into a signal sampled at a second sampling frequency, and outputting the converted signal. An input / output frequency ratio calculating step of calculating a ratio (R) of the sampling frequency of the second sampling frequency to the second sampling frequency; 1 And ) Is calculated, and R is calculated. 1 To the ratio of R to (R 2 And ) Is calculated, and R is calculated. 2 Is any integer R 3 And a replacement step of performing a replacement with a function represented by a reciprocal of a width N of 2 and an R that continues in time series from a signal sampled at the first sampling frequency. 1 Signal values are extracted, and this R 1 Calculating an average value for each signal value, and outputting the average value as an average signal; and sampling the output signal with respect to the sampling point of the input signal using the second power as the sampling period of the average signal. A time position calculating step of calculating a relative time position of a point, linear interpolation is performed on the average signal at the calculated time position, and a value obtained by the interpolation is used as the output signal.
[0013]
BEST MODE FOR CARRYING OUT THE INVENTION
Hereinafter, a sampling frequency conversion device to which the present invention is applied will be described. The sampling frequency conversion device mainly converts the sampling frequency by performing four processes. The first processing is a sampling frequency Fs of the input signal. 1 And the sampling frequency Fs of the output signal 2 Constants R, R 1 , R 2 , R 3 , N, and T. This processing corresponds to steps S1 and S2 in the flowchart. Here, the constant R is the sampling frequency Fs of the input signal. 1 Output signal sampling frequency Fs 2 And R 1 Is a value obtained by approximating R by a power of 2. 2 Is R and R 1 Is a value indicating the error of 3 And N is R 2 Is a value used when approximating by an integer and a power of 2, and T is a value indicating a period between samples in linear interpolation.
[0014]
Hereinafter, the four processes executed by the sampling frequency conversion device 1 will be described with reference to the flowchart of FIG. The sampling frequency conversion device 1 outputs the sampling signal Fs of the input signal. 1 And the sampling frequency Fs of the output signal 2 Constantly monitor changes in 1 And / or Fs 2 Is changed (Step S1; YES), the process proceeds to Step S2, and the constants R, R 1 , R 2 , R 3 , N, T are updated (step S2).
[0015]
In step S2, the sampling frequency converter 1 sets constants R, R 1 , R 2 , R 3 , T are calculated as follows. The sampling frequency conversion device 1 first calculates a constant R. The constant R is the sampling frequency Fs of the input signal. 1 And the sampling frequency Fs of the output signal 2 Is obtained by the following equation (1).
R = Fs 1 / Fs 2 ... (1)
[0016]
Next, the sampling frequency converter 1 calculates a constant R 1 Is calculated. Constant R 1 Is a value obtained by the following equation (2).
R 1 = Pow (2, floor (log2 (max (1, R))) (2)
Where pow (x, y) is a function that returns x to the power of y
floor (x) is a function that returns the largest integer value not exceeding x
log2 (x) is the logarithm when x is base 2
max (x, y) is a function that returns the larger of x and y
It is.
[0017]
R calculated by equation (2) 1 Takes different values depending on whether the input signal is down-sampled or up-sampled. R for downsampling 1 And R for upsampling 1 The difference between the calculation results and will be described.
[0018]
When downsampling, Fs 1 > Fs 2 Therefore, R> 1. At this time, the return value of max (1, R) is R, and R 1 Is the maximum power of 2 that does not exceed R. When downsampling, the constant R 1 Is used as the number of samples for averaging the input signal. R 1 When one average value is obtained from the number of samples, the sampling frequency Fs of the input signal is obtained. 1 Is Fs 1 × (1 / R 1 ). Hereinafter, R 1 The signal averaged for each sample is referred to as an average signal.
[0019]
On the other hand, when upsampling, Fs 1 <Fs 2 And R <1. The return value of max (1, R) is 1, and R 1 Is 1.
[0020]
When upsampling a signal, R 1 Is 1. Obtaining the average value of one sample does not change the value of the sample and the number of samples. Therefore, the input signal is output as it is, and the sampling frequency Fs of the input signal is output. 1 Also does not change.
[0021]
In step S2, the sampling frequency conversion device 1 further calculates R2. R2 is a value obtained by the following equation (3).
R 2 = R / R 1 ... (3)
[0022]
R 2 Is the sampling frequency Fs of the average signal 1 × (1 / R 1 ) To Fs 2 Used as a constant to convert to R 2 The meaning of is explained using a mathematical expression. In the following equation, the sampling frequency of the average signal is Fs Mean Expressed by
Figure 2004129072
[0023]
Thus, the sampling frequency of the average signal is 1 / R 2 When multiplied, the sampling frequency Fs of the output signal 2 Can be requested. However, R 2 Is a divisor of an integer and an integer, so that the value becomes a decimal number, and there is a problem that a circuit scale becomes large when performing an operation by hardware. Then, R 2 Is an integer R 3 It is expressed by a combination of and a width of 2.
[0024]
R 2 = R 3 /Pow(2,N)+Re...(4)
In the formula (4), R 3 , N are integers such that Re ≒ 0. In equation (4), assuming that Re = 0, R 2 = R 3 / Pow (2, N). The sampling frequency conversion device 1 multiplies the number of samples of the average signal by pow (2, N) / R3 to set the sampling frequency of the average signal to Fs. 2 Can be converted to
[0025]
The sampling frequency converter 1 sets the sampling frequency of the average signal to pow (2, N) / R 3 To do so, linear interpolation is used. The sampling frequency conversion device 1 calculates a period as a constant used for linear interpolation. The cycle T is calculated based on the following equation (5). The procedure of the linear interpolation will be described later.
T = pow (2, N) (5)
[0026]
As described above, the constants R, R 1 , R 2 , R 3 , N, T are calculated. In step S1, Fs 1 And Fs 2 Does not change (step S1; NO), the sampling frequency converter 1 sets the constants R and R 1 , R 2 , R 3 , N, and T, without updating the values, the process proceeds to step S3.
[0027]
Next, the sampling frequency conversion device 1 starts the second processing and the third processing. The second process is a process of performing linear interpolation of a signal. The second process mainly corresponds to step S4, step S5, step S10, and step S11 in the flowchart of FIG. The sampling frequency conversion device 1 performs the first linear interpolation in steps S4 and S5, and performs the second linear interpolation in steps S10 and S11. The reason why the sampling frequency conversion device 1 performs the linear interpolation twice is to average the result of the linear interpolation, thereby removing the image noise of the signal.
[0028]
The third process is a process of averaging the input signal for every R1 samples to generate an average signal. The third process corresponds to steps S8 and S14 in the flowchart.
[0029]
The procedure of the linear interpolation performed by the sampling frequency conversion device 1 as the second process will be described with reference to FIG. FIG. 2 is a diagram showing the relationship between the period M, the average signal, and the output signal. The average signal is calculated by dividing the input signal by R 1 This is a signal averaged for each sample. FIG. 2 is a graph with the vertical axis representing amplitude and the horizontal axis representing time. In FIG. 2, black circles indicate the value of the average signal, and black squares indicate the output signal. In this figure, I 1 ~ I 4 Are input in time series. The sampling period of the average signal is set to T. Here, the cycle of the average signal is set to T in the order of input of the signal. 1 , T 2 , T 3 It expresses.
[0030]
First, the time position P is the period T 2 , The sampling frequency conversion device 1 2 Value of storage area B 2 And I 1 Value of storage area B 1 To memorize. And B 1 , B 2 , T, and P are substituted into equation (6) to obtain a linear interpolation S at the time position P. 1 Is calculated.
[0031]
B 3 = B 1 × (TP) + B 2 × P ・ ・ ・ (6)
[0032]
In step S4, when the linear interpolation is completed, the sampling frequency conversion device 1 substitutes the current value of P into Expression (7) and updates the value of P.
P = P + R 3 /2...(7)
Then, when the value of P becomes larger than T (step S6; YES), the process proceeds to step S7. If the value of P does not exceed T (step S6; NO), the sampling frequency conversion device 1 shifts the processing to step S10.
[0033]
If the value of P becomes larger than T in step S6, the time position of P is the period T 3 Move to The sampling frequency converter 1 has a period T 3 To perform linear interpolation on 1 , B 2 Change the value stored in. T 2 Is the leftmost value of T 3 Is the rightmost value of Therefore, the sampling frequency conversion device 1 calculates the period T using equation (8). 2 B in 1 Value of storage area B 2 To shift the memory over time. (Step S7).
B 2 = B 1 ... (8)
[0034]
Period T 3 B in 2 Is set, the sampling frequency converter 1 sets the period T 3 B in 1 Is calculated (step S8). Period T 3 B in 1 Is R 1 This is the average value of the input signals and can be calculated based on equation (9).
B 1 = (I [t + 0] + I [t + 1] +... + I [t + R 1 ] / R 1 ... (9)
Here, since I [t] is represented as an input signal at the input time t, the input signal input next to I [t] has a time series of I [t + 0], I [t + 1],. , I [t + n].
[0035]
When step S8 ends, the sampling frequency conversion device 1 subtracts the value of M from the value of P and adjusts the value of P to be an integer greater than or equal to 0 and less than M (step S9). Equation (10) is an equation for adjusting the value of P. As shown in FIG. 2, the value of P calculated by the equation (10) is equal to the period T 3 Shows the time position of.
P = PM (10)
[0036]
Next, the sampling frequency conversion device 1 performs the second linear interpolation (step S11). The second linear interpolation is performed in the same manner as the first linear interpolation. In step S11, the sum of the result of the first linear interpolation and the result of the second linear interpolation is represented by B 3 Thus, the operation expression is expressed as in Expression (11).
B 3 = B 3 + B 1 × (MP) + B 2 × P ... (11)
[0037]
When the second linear interpolation is completed, the sampling frequency conversion device 1 calculates the value of P according to equation (6) (step S11). If the value of P is larger than T (step S12; YES), Storage area B 1 The value stored in the storage area B 2 (Step S13), and the new B 1 Is calculated (step S14). New B 1 Is calculated, the sampling frequency converter 1 adjusts the value of P by subtracting the value of M from the value of P (step S15). By these processes, B 1 , B 2 , P is calculated, and the next linear interpolation can be executed. Note that the processes in steps S11 to S15 are the same as the processes in steps S5 to S9, respectively, and thus detailed description will be omitted.
[0038]
Next, the sampling frequency conversion device 1 shifts the processing to step S16 and executes the fourth processing. The fourth process is a process of calculating an output signal O by averaging the first linear interpolation and the second linear interpolation. The calculation for averaging the first linear interpolation and the second linear interpolation is represented by the following equation (12).
O = B 3 / (M × 2) (12)
B 3 Is the sum of the first linear interpolation and the second linear interpolation. 3 Is simply divided by 2 to calculate the average of the linear interpolation. In equation (12), B 3 Is divided by M × 2 because the calculation of dividing the entire expression by M is omitted in the calculation of calculating the linear interpolation in Expression (7). Since M × 2 is a power of 2, the operation of Expression (12) can be executed by a simple bit operation. When the processing in step S16 is completed, the sampling frequency conversion device 1 outputs the value calculated in step S16 as an output signal (step S17).
[0039]
Hereinafter, an example of the sampling frequency conversion device 1 that performs the above-described processing will be described. FIG. 3 is a diagram showing a circuit configuration of the sampling frequency conversion device 1. The circuit of the sampling frequency conversion device 1 is classified into four blocks for each processing.
[0040]
3, an adder 19, a DQ flip-flop 20, a divider 21, and a selector 23 are blocks for calculating an average value of an input signal. The multiplier 24, the multiplier 25, the subtractor 26, and the adder 27 are blocks for performing linear interpolation. The adder 32, the DQ flip-flop 31, the selector 34, and the divider 30 are blocks for averaging linear interpolation. The DQ flip-flop 28 and the adder 33 are blocks for calculating the time position P. Further, the microprocessor 35 includes R, R 1 , R 2 , R 3 , T, and N, and the sequencer 36 controls the input signal of the selector.
[0041]
First, a circuit for calculating the average value of the input signal will be described. When a signal is input from the input terminal 18, the input signal is input to the adder 19. A signal from the selector 23 is input to the adder 19 in addition to the input signal. The sequencer 36 determines that the number of additions of the adder 19 is R 1 The switch of the selector 23 is set to A until it reaches. While the switch is set to A, the signal accumulated in the DQ flip-flop 20 is output to the adder 19. The adder 19 adds the input signal and the signal stored in the DQ flip-flop 20, and stores this value in the DQ flip-flop 20. The sequencer 36 determines that the addition number of the adder 19 is R 1 , The switch of the selector 23 is set to B, and the value of the DQ flip-flop 20 is reset. The value cumulatively added to the DQ flip-flop 20 is output to the divider 21. The divider 21 converts the input signal to R 1 Divide by. The output from the divider 21 is R 1 It is the average of the samples.
[0042]
Next, the value output from the divider 21 is output to the DQ flip-flop 22 and the multiplier 24. Since the value output to the DQ flip-flop 22 is delayed by one sample, B 1 And the value output to the multiplier 21 has no delay. 2 Is equivalent to The value of P stored in the DQ flip-flop 28 is output to the multiplier 24, and the product “B” of the average value of the input signal and P is output to the multiplier 24. 2 × P ”is calculated.
[0043]
Further, the subtracter 26 calculates a difference “TP” between the value of P output from the DQ flip-flop 28 and M, and outputs this value to the multiplier 25. In the multiplier 25, the product “B” of the output “TP” from the subtractor 26 and the average value of the input signal 2 × (T−P) ”is required. In the adder 27, the output “B” from the multiplier 24 1 × P ”and the output“ B ”from the multiplier 25 1 × (TP) ”and the sum“ B 1 × (TP) + B 2 × P ”is calculated. Thereby, linear interpolation is performed.
[0044]
The result of the linear interpolation calculated by the adder 27 is output to the adder 32. The output from the selector 34 is input to the adder 32. The sequencer 36 sets the selector switch to A until the number of additions of the adder 32 becomes two. While the switch is set to A, the value stored in the DQ flip-flop 31 is output to the adder 32. Therefore, the adder 32 adds the output from the adder 27 and the value stored in the DQ flip-flop 31, and stores the result in the DQ flip-flop 31. Then, when the number of additions of the adder 32 becomes two, the sequencer 36 switches the switch of the selector 34 to B, resets the value of the DQ flip-flop 31, and divides the value stored in the DQ flip-flop 31. Output to the container 30.
[0045]
The divider 30 divides the value output from the DQ flip-flop 31 by T × 2, and calculates an average value of the result of the linear interpolation. The value calculated by the divider 30 is output to the outside via the output terminal 29 as an output signal.
[0046]
As described above, the sampling frequency conversion device 1 sets the sampling frequency of the input signal to R 1 After the conversion, the data is converted to a target sampling frequency using linear interpolation. When performing upsampling, the sampling frequency conversion device 1 converts the data into a target sampling frequency using only linear interpolation.
[0047]
Sampling frequency conversion device 1 has R 1 By using the arithmetic mean of the number of samples as the output signal, the sampling frequency of the input signal 1 Convert to 1 / R 1 An operation to obtain the sum of the samples, and 1 The operation of dividing by can be realized by a simple circuit.
[0048]
Further, the sampling frequency conversion device 1 sets the cycle in which the sample appears to T, and performs linear interpolation based on the time position P with respect to this cycle T. Displacement R of time position P 3 / 2, and the linear interpolation is R 3 / 2T. R 3 , P are integers and T is a power of two, so linear interpolation is calculated by four arithmetic operations on the power of two and an integer. Therefore, linear interpolation can be realized with a simple circuit.
[0049]
The sampling frequency conversion device 1 sets the sampling frequency of the signal to 2 × Fs 2 And outputs an average of every two samples of the converted signal as an output signal. This process is performed to remove image noise included in the signal. To remove image noise by a circuit, a large circuit is required. In the sampling frequency conversion device 1 to which the present invention is applied, since the image noise can be removed only by the adder, the storage element, and the multiplier, the hardware configuration is simplified.
[0050]
In addition, the sampling frequency converter 1 has a constant R 1 , R 2 , R 3 , T, and N are input to the selector to control the conversion rate of the sampling frequency. Therefore, the sampling frequency Fs of the input signal 1 And the sampling frequency Fs of the output signal 2 Constant R according to the change of 1 , R 2 , R 3 , T, and N, it is possible to cope with a change in the sampling frequency.
[0051]
【The invention's effect】
In order to solve the above problem, a sampling frequency conversion device according to the present invention is provided with a sampling frequency conversion device that inputs a signal sampled at a first sampling frequency, converts the signal into a signal sampled at a second sampling frequency, and outputs the converted signal. Input / output frequency ratio calculating means for calculating a ratio (R) of the first sampling frequency to the second sampling frequency, and a maximum width of 2 (R 1 And ) Is calculated, and R 1 To the ratio of R to (R 2 And ) For calculating the width ratio ratio; 2 Is any integer R 3 And a replacement means for performing replacement by a function represented by a function represented by a reciprocal of the width N of 2 and a signal R sampled at the first sampling frequency. 1 Signal values are extracted, and this R 1 Average signal calculation means for calculating an average value for each of the signal values, and outputting the average value as an average signal; an output signal for a sampling point of the input signal, wherein the second power is used as a sampling period of the average signal. And a time position calculating means for calculating a relative time position of the sampling point, and linearly interpolating the average signal at the calculated time position, and use the value obtained by the interpolation as an output signal. Therefore, it is possible to provide a sampling frequency conversion device which not only has a simple circuit configuration but also easily changes the sampling frequency of an input signal and the sampling frequency of an output signal.
[0052]
Further, the sampling frequency changing method according to the present invention is a sampling frequency conversion method for inputting a signal sampled at a first sampling frequency, converting the signal into a signal sampled at a second sampling frequency, and outputting the converted signal. An input / output frequency ratio calculating step of calculating a ratio (R) of the sampling frequency of the second sampling frequency to the second sampling frequency; 1 And ) Is calculated, and R is calculated. 1 To the ratio of R to (R 2 And ) Is calculated, and R is calculated. 2 Is any integer R 3 And a replacement step of performing a replacement with a function represented by a reciprocal of a width N of 2 and an R that continues in time series from a signal sampled at the first sampling frequency. 1 Signal values are extracted, and this R 1 Calculating an average value for each signal value, and outputting the average value as an average signal; and sampling the output signal with respect to the sampling point of the input signal using the second power as the sampling period of the average signal. A time position calculating step of calculating a relative time position of a point, linear interpolation is performed on the average signal at the calculated time position, and a value obtained by the interpolation is used as the output signal. Therefore, when this method is applied to the sampling frequency converter, the circuit configuration of the sampling frequency converter can be simplified, and the sampling frequency of the input signal and the sampling frequency of the output signal can be easily changed.
[Brief description of the drawings]
FIG. 1 is a flowchart showing a procedure for converting a sampling frequency.
FIG. 2 is a diagram showing a procedure of linear interpolation.
FIG. 3 is a diagram showing a circuit configuration of a sampling frequency conversion device.
[Explanation of symbols]
1 sampling frequency converter, 18 input terminals, 19 adder, 20 DQ flip-flop, 21 divider, 22 DQ flip-flop, 23 selector, 24 multiplier, 25 multiplier, 26 subtractor, 27 adder, 28 DQ flip-flop , 29 output terminals, 30 divider, 31 DQ flip-flop, 32 adder, 33 adder, 34 selector

Claims (12)

第1のサンプリング周波数でサンプリングされた信号を入力し第2のサンプリング周波数でサンプリングされた出力信号に変換して出力するサンプリング周波数変換装置であって、
上記第1のサンプリング周波数の上記第2のサンプリング周波数に対する比(Rとする。)を算出する入出力周波数比算出手段と、
上記Rを超えない最大の2の巾数(Rとする。)を算出する巾数算出手段と、
上記Rに対するRの比(Rとする。)を算出する巾数比算出手段と、
上記Rを任意の整数Rと2の巾数Nの逆数とで表される関数で置換する置換手段と、
上記第1のサンプリング周波数でサンプリングされた信号から時系列に連なるR個の信号値を抽出し、このR個の信号値ごとに一平均値を算出し、この平均値を平均信号として出力する平均信号算出手段と、
上記平均信号に対する上記出力信号の相対的な時間位置を算出する時間位置算出手段と、
上記平均信号を上記時間位置で直線補間する直線補間手段とを有すること
を特徴とするサンプリング周波数変換装置。
A sampling frequency conversion device that inputs a signal sampled at a first sampling frequency, converts the signal into an output signal sampled at a second sampling frequency, and outputs the output signal.
Input / output frequency ratio calculation means for calculating a ratio (R) of the first sampling frequency to the second sampling frequency;
And exponent calculation means for calculating the maximum second width number (and R 1.) Does not exceed the above R,
A width ratio calculating means for calculating a ratio of R (R 2 to.) With respect to the R 1,
Replacement means for replacing the above R 2 with a function represented by an arbitrary integer R 3 and a reciprocal of a width N of 2;
R 1 signal values connected in a time series are extracted from the signal sampled at the first sampling frequency, an average value is calculated for each of the R 1 signal values, and the average value is output as an average signal. Average signal calculating means for
Time position calculating means for calculating a relative time position of the output signal with respect to the average signal;
And a linear interpolation means for linearly interpolating the average signal at the time position.
上記平均信号に対する上記出力信号の相対的な時間位置とは、上記2の巾数Nに対する時間位置(Pとする。)の値であり、
上記時間位置算出手段は、上記Rを任意の整数Uで割った値Vを算出し、任意の初期値に対し上記Vを順次加算し、加算結果がN以上になったときに、加算結果からNを減算し、常に0以上N未満の値を保つ時間位置Pを算出することを特徴とする請求項1記載のサンプリング周波数変換装置。
The relative time position of the output signal with respect to the average signal is the value of the time position (P) for the width N of 2;
It said time position calculating means, the R 3 calculates a value V divided by any integer U, sequentially adds the V for any initial value, when the addition result is equal to or greater than N, addition results 2. The sampling frequency conversion apparatus according to claim 1, wherein N is subtracted from, and a time position P which always keeps a value of 0 or more and less than N is calculated.
上記平均信号を記憶する記憶手段と、
上記記憶手段に記憶された2つの平均信号のうち先に出力された信号をBとし、後に出力された信号をBとし、上記BとBとを上記BとBとの間に位置する時間位置Pで直線補間することを特徴とする請求項2記載のサンプリング周波数変換装置。
Storage means for storing the average signal;
The signals output to out destination of the stored two average signal to said memory means and B 1, a signal output after the B 2, and the B 1 and B 2 between the B 1 and B 2 3. The sampling frequency conversion device according to claim 2, wherein linear interpolation is performed at a time position P located between the two.
上記直線補間の結果(Bとする。)は、以下の式(1)によって算出されることを請求項3記載のサンプリング周波数変換装置。
={B×(N−P)+B×P}/N・・・・(1)
4. The sampling frequency conversion device according to claim 3 , wherein the result of the linear interpolation (B3) is calculated by the following equation (1).
B 3 = {B 1 × (NP) + B 2 × P} / N (1)
上記直線補間の結果をU個ごとに平均化する平均化手段を備えることを特徴とする請求項2記載のサンプリング周波数変換装置。3. The sampling frequency converter according to claim 2, further comprising averaging means for averaging a result of said linear interpolation for each U number. 入力信号のサンプリング周波数Fsと、出力信号のサンプリング周波数Fsとの変化を監視する監視手段を備え、
上記入出力周波数比算出手段、上記巾数算出手段、上記巾数比算出手段、上記置換手段は、上記Fsおよび/またはFsが変化するごとに、R、R、R、R、Nの値を更新することを特徴とする請求項1記載のサンプリング周波数変換装置。
A sampling frequency Fs 1 of the input signal, a monitoring means for monitoring changes in the sampling frequency Fs 2 of the output signal comprises,
The input / output frequency ratio calculating means, the width number calculating means, the width ratio calculating means, and the replacing means change R, R 1 , R 2 , R 3 each time the Fs 1 and / or Fs 2 change. , N is updated. The sampling frequency conversion apparatus according to claim 1, wherein
第1のサンプリング周波数でサンプリングされた信号を入力し第2のサンプリング周波数でサンプリングされた出力信号に変換して出力するサンプリング周波数変換方法であって、
上記第1のサンプリング周波数の上記第2のサンプリング周波数に対する比(Rとする。)を算出する入出力周波数比算出工程と、
上記Rを超えない最大の2の巾数(Rとする。)を算出する巾数算出手段と、
上記Rに対するRの比(Rとする。)を算出する巾数比算出工程と、
上記Rを任意の整数Rと2の巾数Nの逆数とで表される関数で置換する置換工程と、
上記第1のサンプリング周波数でサンプリングされた信号から時系列に連なるR個の信号値を抽出し、このR個の信号値ごとに一平均値を算出し、この平均値を平均信号として出力する平均信号算出工程と、
上記平均信号に対する上記出力信号の相対的な時間位置を算出する時間位置算出工程と、
上記平均信号を上記時間位置で直線補間する直線補間工程とを有すること
を特徴とするサンプリング周波数変換方法。
A sampling frequency conversion method for inputting a signal sampled at a first sampling frequency, converting the signal into an output signal sampled at a second sampling frequency, and outputting the output signal,
An input / output frequency ratio calculating step of calculating a ratio (R) of the first sampling frequency to the second sampling frequency;
And exponent calculation means for calculating the maximum second width number (and R 1.) Does not exceed the above R,
(And R 2.) The ratio of R to said R 1 and width ratio calculating step of calculating a
A replacement step of replacing the above R 2 by a function represented by an arbitrary integer R 3 and a reciprocal of a width N of 2;
R 1 signal values connected in a time series are extracted from the signal sampled at the first sampling frequency, an average value is calculated for each of the R 1 signal values, and the average value is output as an average signal. Average signal calculating step of
A time position calculating step of calculating a relative time position of the output signal with respect to the average signal;
A linear interpolation step of linearly interpolating the average signal at the time position.
上記平均信号に対する上記出力信号の相対的な時間位置とは、上記2の巾数Nに対する時間位置(Pとする。)の値であり、
上記時間位置算出工程は、上記Rを任意の整数Uで割った値Vを算出し、任意の初期値に対し上記Vを順次加算し、加算結果がN以上になったときに、加算結果からNを減算し、常に0以上N未満の値を保つ時間位置Pを算出することを特徴とする請求項7記載のサンプリング周波数変換方法。
The relative time position of the output signal with respect to the average signal is the value of the time position (P) for the width N of 2;
Said time position calculating step, the R 3 calculates a value V divided by any integer U, sequentially adds the V for any initial value, when the addition result is equal to or greater than N, addition results 8. A sampling frequency conversion method according to claim 7, wherein a time position P is calculated by subtracting N from, and always keeping a value of 0 or more and less than N.
上記平均信号を記憶する記憶手段と、
上記記憶手段に記憶された2つの平均信号のうち先に出力された信号をBとし、後に出力された信号をBとし、上記BとBとを上記BとBとの間に位置する時間位置Pで直線補間することを特徴とする請求項8記載のサンプリング周波数変換方法。
Storage means for storing the average signal;
The signals output to out destination of the stored two average signal to said memory means and B 1, a signal output after the B 2, and the B 1 and B 2 between the B 1 and B 2 9. The sampling frequency conversion method according to claim 8, wherein linear interpolation is performed at a time position P located therebetween.
上記直線補間の結果(Bとする。)は、以下の式(1)によって算出されることを請求項9記載のサンプリング周波数変換方法。
={B×(N−P)+B×P}/N・・・・(1)
(And B 3.) The results of the linear interpolation, sampling frequency conversion method according to claim 9, wherein to be calculated by the following equation (1).
B 3 = {B 1 × (NP) + B 2 × P} / N (1)
上記直線補間の結果をU個ごとに平均化する平均化工程を備えることを特徴とする請求項8記載のサンプリング周波数変換方法。9. The sampling frequency conversion method according to claim 8, further comprising an averaging step of averaging a result of the linear interpolation for each U number. 入力信号のサンプリング周波数Fsと、出力信号のサンプリング周波数Fsとの変化を監視する監視工程を備え、
上記入出力比算出工程、上記巾数算出工程、上記巾数比算出工程、上記置換工程は、上記Fsおよび/またはFsが変化するごとに、R、R、R、R、Nの値を更新することを特徴とする請求項7記載のサンプリング周波数変換方法。
It includes the sampling frequency Fs 1 of the input signal, a monitoring step of monitoring changes in the sampling frequency Fs 2 of the output signal,
The output ratio calculating step, the exponent calculation step, the width ratio calculating step, the displacement step, each time the Fs 1 and / or Fs 2 changes, R, R 1, R 2 , R 3, The sampling frequency conversion method according to claim 7, wherein the value of N is updated.
JP2002292860A 2002-10-04 2002-10-04 Sampling frequency conversion device and sampling frequency conversion method Withdrawn JP2004129072A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2002292860A JP2004129072A (en) 2002-10-04 2002-10-04 Sampling frequency conversion device and sampling frequency conversion method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2002292860A JP2004129072A (en) 2002-10-04 2002-10-04 Sampling frequency conversion device and sampling frequency conversion method

Publications (1)

Publication Number Publication Date
JP2004129072A true JP2004129072A (en) 2004-04-22

Family

ID=32283988

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2002292860A Withdrawn JP2004129072A (en) 2002-10-04 2002-10-04 Sampling frequency conversion device and sampling frequency conversion method

Country Status (1)

Country Link
JP (1) JP2004129072A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007049509A (en) * 2005-08-11 2007-02-22 Fuji Electric Retail Systems Co Ltd Equal length compression method of time series data

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007049509A (en) * 2005-08-11 2007-02-22 Fuji Electric Retail Systems Co Ltd Equal length compression method of time series data
JP4544090B2 (en) * 2005-08-11 2010-09-15 富士電機リテイルシステムズ株式会社 Isometric compression method for time series data

Similar Documents

Publication Publication Date Title
KR20060082803A (en) Sample rate converter
JP2002374150A (en) Digital filter and digital-signal filtering method
JPH0629786A (en) Low-accuracy fir filter for digital interpolation
JP4376973B2 (en) Sample rate converter
Pei et al. Fractional bilinear transform for analog-to-digital conversion
JP2009004848A (en) Mixing device
JP2002506603A (en) Sample rate converter using polynomial interpolation
JP2000216664A (en) Filter and method for acquiring its filter coefficient
US8949303B2 (en) Filter
JPH1075159A (en) Digital filter system
US5821884A (en) Sampling rate conversion method and apparatus utilizing an area effect correlation method
JP2004129072A (en) Sampling frequency conversion device and sampling frequency conversion method
JP2010041311A (en) Filter, and configuration system and configuration method of filter
JP4020867B2 (en) Asynchronous sampling rate conversion
US7609181B2 (en) Sampling frequency conversion apparatus
JP5573901B2 (en) Sampling rate converter
JP4648243B2 (en) AC signal measuring instrument and offset adjustment method thereof
JPH06104751A (en) Deltasigma modulation type a/d converter
WO2020132239A1 (en) System and method for signal resampling
JP4857699B2 (en) Filter device
JP3857011B2 (en) Digital high-pass filter and jitter measuring instrument using digital high-pass filter
JP3172046B2 (en) Sampling rate converter
JP2719722B2 (en) Weight signal filtering method and apparatus
JP3154857B2 (en) Interpolated noise shaping quantizer and oversampling DA converter
JPH09312549A (en) Rate conversion circuit

Legal Events

Date Code Title Description
A300 Withdrawal of application because of no request for examination

Free format text: JAPANESE INTERMEDIATE CODE: A300

Effective date: 20060110