©Ò¿×¡u¤@ºû¤º´¡¡v¡]1-D Interpolation¡^¡A´N¬O®Ú¾Ú¤@²Õ¤wª¾ªº¸ê®ÆÂI¡]¥]§t¿é¤J¤Î¿é¥X¡A¨ä¤¤¿é¤J¬O¤@ºû¸ê®Æ¡A¿é¥X¤]¬O¤@ºû¸ê®Æ¡^¡A¨Ó«Ø¥ß¤@Ó³sÄòªº¨ç¼Æ¡A¥H«Kpºâ¥ô·N¿é¤J¸ê®ÆÂI©Ò¹ïÀ³ªº¿é¥XÈ¡C¤@ºû¤º´¡ªº¤èªk«Ü¦h¡AMATLAB ´£¨Ñ¤F¨âºØ°ò¥»¤èªk¡G
- °ò©ó¦h¶µ¦¡ªº¤º´¡ªk
- °ò©óFFT¡]Fast Fourier Transform¡A§Ö³t³Å¥ß¸Âà´«¡^ªº¤º´¡ªk
¥»¸`±N¹ï³o¨âºØ¤èªk¨Ó¶i¦æ»¡©ú¡C
MATLAB ³Ì±`¥Îªº¤@ºû¤º´¡«ü¥O¬O interp1¡A¨äì²z¬O§Q¥Î¦h¶µ¦¡¨Ó¶i¦æ¤º´¡¹Bºâ¡Cinterp1 ªº¨Ï¥Î»yªk¬°
yi = interp1(x, y, xi, method) ¨ä¤¤¦V¶q x ¬O¸ê®ÆÂIªº x ®y¼Ð¡]¿é¤JÈ¡^¡A¦V¶q y ¬O¸ê®ÆÂIªº y ®y¼Ð¡]¿é¥XÈ¡^¡A¦V¶q xi ¬O¤º´¡ÂI¡]¿é¤JÈ¡A¥¼ª¾¨ä¹ïÀ³¿é¥XÈ¡^¡A¦r¦ê method «h«ü©w¨Ï¥Îªº¤º´¡¤èªk¡A¦@¦³¤»ºØ¡G
- 'nearest'¡G¾FªñÂI¤º´¡ªk
- 'linear'¡G½u©Ê¤º´¡ªk
- 'spline'¡G¤ù¬q¦¡ªº¤T¦¸ Spline ¤º´¡ªk
- 'pchip'¡G«O«ù§Îª¬ªº¤ù¬q¦¡¤T¦¸¤º´¡
- 'cubic'¡G©M'pchip' ¤@¼Ë
- 'v5cubic'¡GMATLAB 5 ©Ò¥Îªº¤T¦¸¤º´¡ªk
¦b¤U¦C½d¨Ò¤¤¡A§Ų́ϥΤWz¤èªk¤¤ªº«e¥|ºØ¨Ó¹ï¤@ºû¸ê®Æ¶i¦æ¤º´¡¡G
¥Ñ¤W¹Ï¥i¬Ý¥X¡ASpline ©M Cubic ©Ò²£¥Íªº¦±½u¸û¥·Æ¡A¦ý¥¦Ì©Ò»Ýªºpºâ®É¶¡¤]¸û¤[¡C¥H¤W³o¥|ºØ¤º´¡ªkªº¤ñ¸ûªí¦p¤U¡G
Nearest Linear Cubic Cubic Spline °õ¦æ®É¶¡ 1¡]µu¡^ 2 3 4¡]ªø¡^ ¦±½u¥·Æ«× 1¡]®t¡^ 2 3 4¡]¦n¡^ °O¾ÐÅé¨Ï¥Î¶q 1¡]¤Ö¡^ 2 4¡]¦h¡^ 3 ¦b¨Ï¥Î interp1 ®É¡A¦V¶q x ¥²¶·¬OÄY®æ»¼¼W©Î»¼´î¡A¦ý¤¸¯À¤§¶¡¤£¥²¬Oµ¥¶¡¹j¡C¦¹¥~¡Axi ªº½d³ò¤]¥²¶·¸¨¦b x ªº½d³ò¤§¤º¡A¤~¯à¶i¦æ¤º´¡ªº¹Bºâ¡C
¦b¤Wz½d¨Òªº¹Ï§Î¡A¥i¯à¤£®e©ö¬Ý¥X¨C¤@ºØ¤èªkªº®ÄªG¡Aµ§ªÌ¯S§O¥t¥~¼g¤F¤@Óµ{¦¡¡A¥i¥HÅý¨Ï¥ÎªÌ©ì©ñ¨ú¼ËÂI¡A¤º´¡¦±½u´N·|¸òµÛ§ïÅÜ¡AÀɮצWºÙ¬O interpAnim01.m¡A°õ¦æ«áªº¹Ï§Î¦p¤U¡G
¨Ï¥ÎªÌ¥i¥H¦b¤Wz¹Ï§Îµøµ¡¤¤¡A©ì©ñ¨C¤@Ó¨ú¼ËÂI¡A´N¥i¥H¥ß¨è¬Ý¨ì¤º´¡¦±½uªºÅܤơA¤]¦P®É¥i¥Hª¾¹D¦UºØ¤º´¡¤èªkªº¯S©Ê¡C
°£¤F interp1 ¤§¥~¡A¥t¤@Ó¸û¤Ö¥Îªº MATLAB ªº«ü¥O interpft ¥i¶i¦æ°ò©ó FFT¡]Fast Fourier Transform¡A§Ö³t³Å¥ß¸Âà´«¡^ªº¤º´¡ªk¡C¦¹¤èªk¥ýpºâ¸ê®ÆÂIªº³Å¥ß¸Âà´«¡A¦A¥Î§ó±K¶°ªº¤º´¡ÂI¨Ó¶i¦æ¤Ï³Å¥ß¸Âà´«¡Cinterft ªº¨Ï¥Î»yªk¬°
y = interpft(yi, n) ¨ä¤¤¦V¶q yi ¬O¤@Ó¸g¥Ñµ¥¶Z¨úÂIªº¨ç¼ÆÈ¡An «h¬Oµ¥¶Z¨úÂIªº¤º´¡ÂI¼Æ¡C¨Ò¦p¡G
¦pªG§ÚÌn®Ú¾Ú¥±¤Wªº¦³¸ê®ÆÂI¡A¨Ó´yøªì¤@Óª«Å骺¥~«¬¡A¤]¥i¥H¨Ï¥Î¤@ºû¤º´¡¡A¦ý¬O¦¹®É¤º´¡¸ê®ÆÂI·|Åܦ¨¨â²Õ¡A¤À§O¬O
- X®y¼Ð¹ï¨ä¯Á¤Þ¡]Index¡A©ÎºÙ«ü¼Ð¡^ªº¤º´¡
- Y®y¼Ð¹ï¨ä¯Á¤Þ¡]Index¡A©ÎºÙ«ü¼Ð¡^ªº¤º´¡
¦b¤U¦C½d¨Ò¤¤¡A§Ú̦@¦³¤CÓ¸ê®ÆÂI¡A´²§G¦b¤G«×ªÅ¶¡¡A§ÚÌ¥i¥H¨Ï¥Î interp1 ªº spline ¤èªk¡A¨Óµe¥X³sÄò¥·Æªº¹Ï§Î¡A¦p¤U¡G
¦b¤Wz½d¨Ò¤¤¡A즳ªº¸ê®Æ¥u¦³¤CÂI¡A¦ý¬O¨Ï¥Î¤@ºû¤º´¡¡A§ÚÌ´N¥i¥H²£¥Í¥·Æ³sÄòªº¹Ï§Î¡A³o¤]¬O¦b¹q¸£¹Ï¾Ç¡]Computer Graphics¡^³Ì±`¨£ªº°µªk¡A¤]´N¬O¥H¤Ö¼Æ±±¨îÂI¡]Control Points¡^¨Ó¥Nªí¤@Óª«¥ó¡AµM«á¦A¨Ï¥Î¤º´¡¨Ó²£¥Í¾ãÓª«¥óªº²Ó½o¹Ï§Î¡C
·íµM¡A¦pªG§ÚÌ¿ï¥Î¤£¦Pªº¤èªk¡A±o¨ìªº¥·Æ®ÄªG¤]·|¤£¦P¡A¤U¦C½d¨Ò¨Ï¥Î interp1 ªº¥|ºØ¤èªk¡A¨Ó¹ï¤W¤@Ó½d¨Òªº¸ê®ÆÂI¶i¦æ¤º´¡¡A¦p¤U¡G
¦P¼Ë¦a¡A¦b¤Wz½d¨Òªº¹Ï§Î¡A¥i¯à¤£®e©ö¬Ý¥X¨C¤@ºØ¤èªkªº®ÄªG¡Aµ§ªÌ¯S§O¥t¥~¼g¤F¤@Óµ{¦¡¡A¥i¥HÅý¨Ï¥ÎªÌ©ì©ñ¨ú¼ËÂI¡A¤º´¡¦±½u´N·|¸òµÛ§ïÅÜ¡AÀɮצWºÙ¬O interpAnim02.m¡A°õ¦æ«áªº¹Ï§Î¦p¤U¡G
³oÓ®i¥Üµ{¦¡«Ü¦³½ì¡A½ÐŪªÌ°È¥²¦Û¤v¸Õ¬Ý¬Ý¡A©ì©ñ´XÓ±±¨îÂI¡A¬Ý¬Ý·|²£¥Í¤°»ò¤£¦P®ÄªGªº¤º´¡¦±½u¡C
MATLABµ{¦¡³]p¡G¶i¶¥½g