Sweep VEP (Visual Evoked Potential)

 

Ai-Hou Wang, M.D., Ph.D.

 

 

我1990夏到1991夏在舊金山The Smith-Kettlewell Eye Research Institute (SKERI)進修小兒眼科及斜視(Fellowship of Pediatric Ophthalmology and Strabismus)的一年裡,有幸接觸到兩套電生理的設計,其一是Dr. Erich Sutter的多焦網膜電圖(Multifocal ERG),其二是Dr. Anthony Norcia和Dr. Christopher Tyler的掃掠視誘發電位(Sweep VEP)。目前國際臨床視覺電生理學會(International Society for Clinical Electrophysiology of Vision, ISCEV)已經有多焦網膜電圖的標準(https://iscev.wildapricot.org/standards),掃掠視誘發電位的標準還沒有列入。除了臨床使用之外,這兩項工具也是視覺的基礎科學研究的利器。

 

During my year-long Fellowship of Pediatric Ophthalmology and Strabismus at The Smith-Kettlewell Eye Research Institute (SKERI) in San Francisco from the summer of 1990 to the summer of 1991, I had the opportunity to learn about two electrophysiological designs: Dr. Erich Sutter's multifocal electroretinography (ERG) and Dr. Anthony Norcia and Dr. Christopher Tyler's sweep visual evoked potentials (Sweep VEP). Currently, the International Society for Clinical Electrophysiology of Vision (ISCEV) has standards for multifocal ERG (https://iscev.wildapricot.org/standards), but standards for sweep visual evoked potentials have not yet been included. Besides clinical use, these two tools are also invaluable for basic scientific research in vision.

 

 

    

Dr. Anthony Norcia    Dr. Christopher Tyler

 

臨床上圖像視誘發電位(Pattern Visual Evoked Potential)使用西洋棋盤反轉(Checkerboard reversal),兩眼分開各自作,每一眼作四種大小的格子 – 每邊16格,32格,64格和128格(見圖),格子的大小則是邊長1°,1/2°,1/4°和1/8°。嚴謹的實驗室每種情境作兩次,將波型重疊一起,展示實驗的穩定性和可重現性(Reproducibility)。

 

Clinically, pattern visual evoked potentials (PDPs) are performed using checkerboard reversal, with each eye tested separately. Each eye tests four different grid sizes – 16, 32, 64, and 128 squares per side (see figure), with grid sizes of 1°, 1/2°, 1/4°, and 1/8°. In rigorous laboratory settings, each scenario is tested twice, with the waveforms superimposed to demonstrate the stability and reproducibility of the experiment.

 

 

      

 

通常作暫態視誘發電位(Transient VEP),每秒反轉3.7次(3.7reversals)(見圖)。加總100次腦波(average)以提高訊噪比(Signal/Noise Ratio)√100=10倍。至少需時27秒(3.7 reversals/sec à 27 sec/100reversals)。嬰幼兒通常沒有辦法長時間注視著這麼無聊的畫面。

 

這是一位左眼弱視的病人,右眼視力極佳,1/8°最小的格子仍然誘發出大電位,格子漸小,可見峰谷潛值逐漸拉長。左眼弱視,第二條、1/2°格子的誘發電位已經看不清NPN波型了。

 

Transient visual evoked potentials (VEPs) are typically performed, with 3.7 reversals per second (see figure). The average of 100 brainwaves is summed to improve the signal-to-noise ratio (SNR) by √100 = 10 times. This requires at least 27 seconds (3.7 reversals/sec �� 27 sec/100 reversals). Infants and young children typically cannot stare at such a boring image for an extended period.

 

This is a patient with amblyopia in the left eye and excellent vision in the right eye. Even the smallest square at 1/8° still evoked a large potential; as the squares decreased, the peak-to-trough potentials gradually lengthened. In the left eye with amblyopia, the NPN waveform in the second square at 1/2° was no longer clearly visible.

 

 

 

為了以電生理的方法快速評估視覺功能,在1970、1980年代,Dr. Christopher Tyler和Dr. Anthony Norcia開發了掃掠視誘發電位(Sweep VEP)的系統,估計小兒視力(visual acuity)、對比敏感度(contrast sensitivity)和游標視力(vernier acuity)的發育。這個系統由1970、80年代發展至今,叫做PowerDiva。

 

To rapidly assess visual function using electrophysiological methods, Dr. Christopher Tyler and Dr. Anthony Norcia developed the sweep visual evoked potential (SEP) system in the 1970s and 1980s to estimate the development of visual acuity, contrast sensitivity, and vernier acuity in children. This system, developed from the 1970s and 80s to the present day, is called PowerDiva.

 

 

 

只要記錄10秒的腦波。作穩態視誘發電位,每半秒變換一次圖像的參數,10秒共展示20種大小。

 

評估視力,是用正弦柵紋,由寬而窄,依空間頻率(spatial frequency)線性(linear)地掃掠20種寬度(見圖)。

 

Only 10 seconds of brainwave recording are needed. Steady-state visual evoked potentials are generated, with image parameters changing every half second, displaying 20 different sizes over 10 seconds.

 

Visual acuity is assessed using a sinusoidal grating, sweeping across 20 widths linearly according to spatial frequency, from wide to narrow (see figure).

 

 

Sweep Spatial Frequecy (Size) (Visual Acuity)

Linearly from Low to High Spatial Frequency (From Large to Small size)

 

評估對比敏感度,是用固定寬度的正弦柵紋,對比有小而大,依對比(contrast)等比(logarithmic)地掃掠20種對比(見圖)。

 

To assess contrast sensitivity, a sinusoidal grating of fixed width was used, with contrasts ranging from small to large, sweeping across 20 contrasts in logarithmic proportions (see figure).

 

 

Sweep Contrast (Contrast Sensitivity)

Logarithmically from Low to High Contrast

 

評估游標視力,是用方波柵紋,錯位(offset)由窄而寬,依空間頻率(spatial frequency)等比(logarithmic)地掃掠20種寬度(見圖)。

 

To assess vernier vision, a square wave grating is used, with offsets ranging from narrow to wide, sweeping across 20 different widths in logarithmic proportions according to spatial frequency (see figure).

 

 

Sweep Offset (Vernier Acuity)

Logarithmically from Small to Large Offset

 

全部10秒的腦波,取2秒為一個區塊 – 0到2秒為一個區塊、0.5到2.5秒為一個區塊、1到3秒為一個區塊……7.5到9.5秒為一個區塊、8到10秒為一個區塊,一共17個區塊。評估視力的柵紋如果以6Hz(12 reversals/sec)反轉,2秒的區塊裡有24個反轉,抽取這2秒腦波的24倍頻(24th harmonic)的振幅(amplitude)和相位(phase)。同時抽取每一區塊23倍頻(23rd harmonic)和25倍頻(25th harmonic)的振幅,兩者的平均值當作雜訊(noise),噪訊比低,表示24倍頻上確實是誘發而來的電位(見圖)。

 

The entire 10-second brainwave was divided into 2-second blocks – 0 to 2 seconds, 0.5 to 2.5 seconds, 1 to 3 seconds, ... 7.5 to 9.5 seconds, 8 to 10 seconds, for a total of 17 blocks. If the visual acuity grating reverses at 6 Hz (12 reversals/sec), there are 24 reversals in a 2-second block. The amplitude and phase of the 24th harmonic of this 2-second brainwave were extracted. Simultaneously, the amplitudes of the 23rd and 25th harmonics were extracted from each block, and the average of these two was taken as noise. A low signal-to-noise ratio indicates that the potential at the 24th harmonic was indeed induced (see figure).

 

 

 

將17個2秒區塊得到的17個振幅和17個相位,以及17個區塊的雜訊作圖如下(見圖)。當反轉柵紋漸漸變窄,誘發電位幅度漸漸變小,相位漸漸移位(相當於暫態視誘發電位的潛值漸漸變長)。綜合三個值來估計視力的閾值(threshold),也就是估計柵紋變到多細,受試者就看不到反轉了。

1.     外插(extrapolate)高空間頻率處的振幅(紅線),0電位處的空間頻率作為視力估計值。

2.     相位漸漸移位,移位趨勢轉向或變亂,該處的空間頻率作為視力估計值。

3.     噪訊比(noise/signal)漸漸變大,明顯快速變大的地方的空間頻率作為視力估計值。(見圖)

 

The following diagram plots the 17 amplitudes and 17 phases obtained from 17 2-second blocks, along with the noise from each block (see figure). As the inversion grating gradually narrows, the evoked potential amplitude gradually decreases, and the phase gradually shifts (equivalent to the potential value of the transient visual evoked potential gradually increasing). These three values ​​are combined to estimate the visual acuity threshold, that is, how fine the grating needs to become before the subject can no longer see the inversion.

 

1. Extrapolate the amplitude at high spatial frequencies (red line); the spatial frequency at 0 potential is used as the visual acuity estimate.

 

2. Gradually shift the phase; if the shift trend reverses or becomes disordered, the spatial frequency at that point is used as the visual acuity estimate.

 

3. Gradually increase the noise/signal ratio; the spatial frequency at the point where it increases significantly and rapidly is used as the visual acuity estimate. (See figure)

 

 

 

這套系統可以改變的參數有許多,分析方法主要使用傅立葉轉換抽取某幾個頻率的振幅和相位,感覺上並不難寫。

 

通常想要知道對某一參數的視覺閾值(Threshold),這套系統的標準設定是,視刺激的圖形每半秒改變一次,10秒中共掃掠20個圖形。可以從比較看得清楚漸漸變到比較看不清楚,這套系統掃掠視力,或者說是空間頻率(spatial frequency),就是由大條紋掃掠向小條紋;也可以相反過來,這套系統掃掠對比(contrast)和掃掠游標視力(vernier acuity),就是從比較看不清楚漸漸掃掠到比較看得清楚(見圖)。

 

20個圖形改變的方式和速度也要考量:掃掠視力使用的柵紋的空間頻率是線性(linear)變化的,空間頻率的單位是每度視角幾周(cycles per degree),是視角的倒數,相當於Snellen視力,和現今使用的對數(logMAR)視力表就不一樣了。掃掠對比,由弱對比到強對比,每一步是依對數(logarithmic)增加的。對比的單位通常是用(最高亮度-最低亮度)/平均亮度。掃掠游標視力,雖然和柵紋(grating)視力一樣,也是空間大小的概念,但是游標柵紋的錯位由小而大卻是依對數增加的(見圖)。

 

This system allows for the modification of many parameters. The analysis method primarily uses Fourier transform to extract the amplitude and phase of certain frequencies, which seems straightforward to implement.

 

To determine the visual threshold for a specific parameter, the standard setting of this system is to change the visual stimulus pattern every half second, scanning 20 patterns in 10 seconds. The pattern can gradually transition from relatively clear to relatively unclear; this system scans for visual acuity, or spatial frequency, moving from large stripes to small stripes. Conversely, it can scan for contrast and vernier acuity, gradually transitioning from relatively unclear to relatively clear (see figure).

 

The manner and speed of change of the 20 patterns must also be considered: the spatial frequency of the grating used for visual acuity scanning changes linearly. The unit of spatial frequency is cycles per degree of visual field (FIN), which is the reciprocal of the FIN, equivalent to Snellen visual acuity, unlike the logMAR visual acuity charts used today. Sweeping contrast, from weak to strong, increases logarithmically at each step. The unit of contrast is usually (highest brightness - lowest brightness) / average brightness. Sweeping vernier vision, although similar to grating vision in that it is a concept of spatial size, involves the vernier grating misalignment increasing logarithmically from small to large (see figure).

 

 

    

 

   

 

Tyler CW, Apkarian P, Levi DM, Nakayama K. Rapid assessment of visual function: an electronic sweep technique for the pattern visual evoked potential. Invest Ophthalmol Vis Sci. 1979 Jul;18(7):703-13.

Norcia AM, Tyler CW, Hamer RD. Development of contrast sensitivity in the human infant. Vision Res. 1990;30(10):1475-86.

Skoczenski AM, Norcia AM. Development of VEP Vernier Acuity and Grating Acuity in Human Infants. Invest Ophthalmol Vis Sci. 1999;40:2411–2417.

Hou C, Good WV, Norcia AM. Detection of amblyopia using sweep VEP Vernier and grating acuity. Invest Ophthalmol Vis Sci. 2018;59:1435–1442.

 

前面所述傅立葉分析是用2秒為一區塊,相鄰區塊間隔0.5秒,則10秒共有17個區塊。但是如下圖,如果分析的區塊長1秒,間隔0.5秒,則10秒裡就會有19個區塊了。區塊的長度和相鄰區塊的間隔可以任意改變,同時也決定了10秒裡區塊的總數。例如區塊長3秒、區塊間隔1秒,則區塊總數是8個區塊。

 

The Fourier analysis described earlier uses a 2-second block size with a 0.5-second interval between adjacent blocks, resulting in 17 blocks in 10 seconds. However, as shown in the diagram, if the analyzed blocks are 1 second long with a 0.5-second interval, there will be 19 blocks in 10 seconds. The block length and the interval between adjacent blocks can be arbitrarily changed, which also determines the total number of blocks in 10 seconds. For example, if the block length is 3 seconds and the block interval is 1 second, the total number of blocks is 8.

 

 

 

如果視刺激的頻率是3.75Hz,區塊長2秒,則2秒裡有7.5個周期。傅立葉分析7.5倍頻(7.5th harmonic)是基頻(1f),15倍頻(15th harmonic)是2倍頻率(2f)。

 

如果10秒都不改變圖形,當然就不叫作掃掠視誘發電位,但是依舊可以利用這個系統的傅立葉分析。將原本2秒的區塊拉長到10秒,當然全程也就只有1個區塊。就如同穩態/暫態視誘發電位 Steady-state vs. Transient VEP一文裡描述的“運動覺/視動眼震鼻顳側不對稱的視誘發電位”,振動(jittering)的柵紋如果以6Hz振動,10秒鐘總共振動了60個周期。在10秒的腦波裡,以傅立葉分析抽取60倍頻(60th harmonic)的振幅和相位是基頻(1f),120倍頻(120th harmonic)的振幅和相位是2倍頻率(2f)。

 

If the visual stimulus frequency is 3.75 Hz and the block length is 2 seconds, then there are 7.5 cycles in 2 seconds. Fourier analysis shows that the 7.5th harmonic is the fundamental frequency (1f), and the 15th harmonic is the second harmonic (2f).

 

If the pattern doesn't change for 10 seconds, it's not called a swept visual evoked potential, but Fourier analysis of this system can still be used. Extending the original 2-second block to 10 seconds results in only one block throughout. Similar to the "kinesthetic/optico-nystagmus nasotemporal asymmetric visual evoked potential" described in the article "Steady-state vs. Transient VEP," if the jittering grating vibrates at 6 Hz, it vibrates for a total of 60 cycles in 10 seconds. In a 10-second brainwave, the amplitude and phase of the 60th harmonic frequency extracted by Fourier analysis are the fundamental frequency (1f), and the amplitude and phase of the 120th harmonic frequency are the 2nd harmonic frequency (2f).

 

 

 

關於圖像視刺激器,大部分電腦螢幕的速度(frame rate)每秒展示大約60張圖象,或說60格(frames)。快速的圖象轉換,如果能夠在下一幕/下一格出現之前完成計算、推出新畫面,在電腦螢幕的展示功能上,就算達到“即時”(real-time)的門檻。

 

圖像視誘發電位以電腦螢幕呈現圖象,每秒呈現60張圖象,好像膠片電影每秒呈現24張圖象一樣。在圖象1/圖象2交替呈現的情況(例如西洋棋盤反轉是西洋棋盤1和西洋棋盤2交替呈現),如果每一圖象停留1格,每一周就是2格,每秒就是30周(cycle,Hz)或60反轉(reversal)。如果每一圖象停留4格,就是7.5Hz、15反轉;每一圖象停留3格,就是10Hz、20反轉……。總之,那必須是整數、60除得盡的整數。

 

作視覺實驗時,3Hz、6反轉常被用作慢的時間頻率(low temporal frequency),而5Hz、10反轉常被用作快的時間頻率(high temporal frequency)。傅立葉分析抽取基頻(1f)是每秒腦波抽取3倍頻(3rd harmonic)或5倍頻(5th harmonic);抽取2倍頻率(2f)是每秒腦波抽取6倍頻(6th harmonic)或10倍頻(10th harmonic)。

 

如果電腦程式設計呈現圖象不和螢幕同步,或者每秒圖象數不是60的約數,螢幕上的動態圖象就會出現斷線,而受試者接受到的視覺刺激就不在你設計、控制的範圍之內。

 

Regarding visual evoked potentials (VAPs), most computer screens display approximately 60 images per second, or 60 frames. Rapid image transitions, where calculations are completed and new images are displayed before the next frame appears, represent a "real-time" threshold in computer screen display functionality.

 

Visual evoked potentials (VAPs) display images on a computer screen at 60 frames per second, similar to the 24 frames per second of film. In cases where image 1/image 2 alternates (e.g., in chessboard reversal, chessboard 1 and chessboard 2 alternate), if each image stays on one frame, each cycle is 2 frames, resulting in 30 cycles (Hz) or 60 reversals per second. If each image stays on four frames, it's 7.5 Hz with 15 reversals; if each image stays on three frames, it's 10 Hz with 20 reversals, and so on. In short, the frequency must be an integer, divisible by 60.

 

In visual experiments, 3Hz and 6Hz inversion are often used as low temporal frequencies, while 5Hz and 10Hz inversion are often used as high temporal frequencies. Fourier analysis extracts the fundamental frequency (1f) by extracting the 3rd or 5th harmonic per second of brainwaves; extracting the 2nd harmonic (2f) involves extracting the 6th or 10th harmonic per second of brainwaves.

 

If the computer program's image presentation is not synchronized with the screen, or if the number of images per second is not a divisor of 60, the dynamic images on the screen will appear discontinuous, and the visual stimulation received by the subject will be outside the range designed and controlled.

 

 

 

除了掃掠視力、對比和游標視力之外,色覺、雙眼視、......任何視覺的閾值(threshold),原則上都可以設計成逐漸改變的圖象來記錄掃掠視誘發電位。這是電生理的閾值,可以和心理物理實驗得到的閾值相互比較參考。現今的多電極腦波/誘發電位記錄則可以研究這一視覺參數變化過程的大腦定位。

 

嬰幼兒的視力,視誘發電位的估計值比偏好注視(preferential looking)的估計值高出許多,在一歲左右就達到1.0的視力,和臨床的經驗不太吻合。一直到近年仍然在嘗試,是作游標視力或是作柵紋視力的掃掠視誘發電位比較接近於臨床上弱視的評估(Hou, 2018)。掃掠的參數則嘗試是由小條紋掃掠到大條紋,或者相反;是線性地改變大小,或是對數地改變大小;是圖象反轉(pattern reversal)或是圖象出現/消失(pattern onset/offset);是分析基頻(1f)或是分析2倍頻率(2f)......。

 

Besides grazing visual acuity, contrast, and vernier visual acuity, the thresholds for color vision, binocular vision, and any other visual field can, in principle, be designed to record grazing visual evoked potentials (VEPs) using gradually changing images. These are electrophysiological thresholds, which can be compared and referenced with thresholds obtained from psychophysical experiments. Modern multielectrode EEG/evoked potential recordings can then be used to study the brain localization of these visual parameter changes.

 

In infants and young children, the estimated values ​​of visual evoked potentials are much higher than those estimated by preferred looking, reaching 1.0 visual acuity around one year of age, which doesn't quite match clinical experience. Until recently, there has been ongoing research suggesting that grazing visual evoked potentials based on vernier visual acuity or grating visual acuity are closer to the clinical assessment of amblyopia (Hou, 2018). The sweep parameters can be adjusted to sweep from small stripes to large stripes, or vice versa; to change the size linearly or logarithmically; to reverse the pattern or to make the pattern appear/disappear; to analyze the fundamental frequency (1f) or the double frequency (2f)...

 

 

Hou C, Good WV, Norcia AM. Detection of amblyopia using sweep VEP Vernier and grating acuity. Invest Ophthalmol Vis Sci. 2018;59:1435–1442.

 

 

先天內斜視病人的運動覺/視動眼震是鼻顳側不對稱的,會將反轉柵紋看成向左或向右移動的柵紋,並引發視動眼震(optokinetic nystagmus)。掃掠柵紋視力(grating acuity)於是改用柵紋和平均亮度的空白畫面交替出現(grating onset/offset)(見圖)。這樣的話,傅立葉分析應該要分析基頻(1f)而不是2倍頻率(2f)了。

 

In patients with congenital esotropia, the kinesthetic/optico-nystagmus is asymmetrical on the nasotemporal side, causing them to perceive inverted grating lines as moving to the left or right, thus triggering optokinetic nystagmus. Grazing acuity is then achieved by alternating between grating lines and blank areas of average brightness (grating onset/offset) (see figure). Therefore, Fourier analysis should analyze the fundamental frequency (1f) instead of its second harmonic (2f).

 

 

 

 

PowerDiva 1980年代的原型是寫在Apple-II電腦上的,年輕人已經沒法想像那是多麼原始的電腦了,記憶體(RAM)只有64KB!在那樣艱困的環境下,得靠高超的程式技術來補足。記得浙大副教授唐渝當時也在Tony的實驗室設計程式,設法改進誘發電位抽取信號的速度和效率。

 

10秒記錄之前,通常有幾秒的先置適應(adaptation)畫面,測試者確定幼兒的專注力來到螢幕上了,才按鈕啟動正式的視刺激掃掠畫面。

 

即便只需要10秒鐘注視螢幕,許多幼兒還是沒法一次完成。測試者發現他的視線移開螢幕時,立即按鈕暫停記錄腦波;等將他的注意力吸引回螢幕之後,再按鈕開始記錄。重啟的記錄會重複部分暫停前的視刺激,之後將幾段腦波裁減、連接起來,得到正好10秒鐘的腦波進行分析。(見圖,再看一次幼兒視誘發電位的檢查畫面)

 

The PowerDiva prototype from the 1980s was programmed into an Apple II computer—a very primitive computer for modern people to imagine, with only 64KB of RAM! In such a challenging environment, advanced programming technology was needed to compensate. I remember Tang Yu, an associate professor at Zhejiang University, was designing programs in Tony's lab at the time, trying to improve the speed and efficiency of evoked potential signal extraction.

 

Before the 10-second recording, there were usually a few seconds of adaptation screen. The tester confirmed that the child's attention was on the screen before pressing the button to start the formal visual stimulus sweep.

 

Even though only 10 seconds of screen focus was required, many children couldn't complete it in one go. When the tester noticed the child's gaze leave the screen, they immediately paused the brainwave recording; after drawing the child's attention back to the screen, they resumed recording. The restarted recording repeated parts of the visual stimulus before the pause, and then the brainwave segments were trimmed and connected to obtain exactly 10 seconds of brainwave data for analysis. (See the image; view the examination footage of visual evoked potentials in young children again.)

 

 

 

目前PowerDiva這套系統在美國許多醫學中心、視覺研究中心使用中。

 

另一套包含掃掠視誘發電位的系統則是Diopsys Enfant® Pediatric Visual Evoked Potential Module (見圖)

 

The PowerDiva system is currently used in many medical centers and vision research centers in the United States.

 

Another system that includes grazing visual evoked potentials is the Diopsys Enfant® Pediatric Visual Evoked Potential Module (see figure).

 

 

 

 

光電管(photocell)作為視誘發電位實驗室的模型眼 – 測試系統的正確性

 

之前製作的實體找不到了,網路上找些材料圖來解說。

 

主體是那顆光電阻(photoresistor),焊在BNC座上,固定在底片盒底。視誘發電位用的腦波放大器(amplifier)通常放大100,000×,光電管直接接上去電太大,並連一個電阻(BNC terminator)就剛好。

 

A photocell serves as the model eye in a visual evoked potential (VAP) lab – testing the system's correctness.

 

The original physical model is lost, so I'm using material diagrams found online for explanation.

 

The main component is the photoresistor, soldered to a BNC connector and fixed to the bottom of the film holder. The EEG amplifier used for VEP typically amplifies by 100,000×; directly connecting the photocell would result in too much voltage, so connecting a resistor (BNC terminator) is just right.

 

 

 

這是我們以光電管替代人眼,測試自己開發的掃掠視誘發電位的電腦程式與系統。振幅(amplitude)和相位(phase)都十分完美。

 

This is our computer program and system for testing our self-developed swept visual evoked potentials, using phototubes instead of the human eye. The amplitude and phase are both perfect.

 

 

 

如果自行開發多焦網膜電圖/視誘發電位(Multifocal ERG/VEP)電腦系統,一樣可以用光電管替代人眼,測試並偵錯系統是否正確。

 

If a multifocal ERG/VEP computer system is developed in-house, phototubes can be used to replace the human eye to test and detect whether the system is correct.

 

 

 

附記 – 數位傅立葉分析 (Digital Fourier Analysis)

 

附上簡短的BASIC語言程式:

橫軸h個點

抽取m倍頻(mth harmonic)

 

[非快速傅立葉傳換(Fast Fourier Transform, FFT)]

 

Postscript – Digital Fourier Analysis

 

A short BASIC program is attached: Horizontal axis: h points Decimate by m harmonics

 

[Non-Fast Fourier Transform (FFT)]

 

 

    real = 0: imag = 0

 

    FOR i = 0 TO h - 1

        real = real + y(i) * COS(2 * pi * i * m / h)

        imag = imag + y(i) * SIN(2 * pi * i * m / h)

    NEXT

 

    amp = (real ^ 2 + imag ^ 2) ^ .5 / h * 2

 

    IF real = 0 AND imag > 0 THEN

        phase = .5 * pi

    ELSEIF real = 0 AND imag < 0 THEN

        phase = 1.5 * pi

    ELSE

        phase = ATN(imag / real)

        IF real < 0 THEN phase = phase + pi

        IF real > 0 AND imag < 0 THEN phase = phase + 2 * pi

    END IF

    IF phase >= 2 * pi THEN phase = phase - 2 * pi

phase = phase / pi