%!PS % Gonzo PS Powerpoint emulation example: Intro to Magic Sinewaves % ========================================== % by Don Lancaster % Copyright c 2002 by Don Lancaster & Synergetics, Box 809, Thatcher, AZ, 85552 % (928) 428-4073 Email: don@tinaja.com Website: http://www.tinaja.com % Consulting services available http://www.tinaja.com/info01.html % Linking welcome. Reposting expressly forbidden. % All commercial rights and all electronic media rights ~fully~ reserved. % Linking usually welcome. Reposting expressly forbidden. Version 1.1 % Shows how most PowerPoint functions can be created from raw PostScript % with significant speed, size, appearance, and web distribution advantages. % To use, modify features and content as desired, resave as a standard ASCII % textfile to a new name and send to Acrobat Distiller to generate a PDF file. % IMPORTANT NOTE: Don Lancaster's file gonzo.ps is required for this program. % After obvious location mods, uncomment ONE of the following two lines: (C:\\Documents and Settings\\don\\Desktop\\gonzo\\gonzo.ps) run % use internal gonzo % (A:\\gonzo.ps) run % use external gonzo % NOTE THAT ALL PS FILENAME STRINGS !!!DEMAND!!! DOUBLE REVERSE SLASHES. % GONZO20A Guru Gonzo PostScript power tools (Interim release) % Includes gonzo justification and layout utilities. % Copyright c 1990, 1996, 2001 by Don Lancaster and Synergetics, Box 809, % Thatcher Arizona, 5552 (928) 428-4073 don@tinaja.com support % via http://www.tinaja.com All commercial rights and all electronic % media rights **FULLY** reserved. Reposting is expressly forbidden. /guru { gonzo begin ps.util.1 begin printerror nuisance begin} def % guru % activate gonzo utilities %%%%%%%%%%% links menu directory %%%%%%%%%%%% % This code locks pdfmark commands out of a PostScript printer. /pdfmark where {pop}{userdict /pdfmark /cleartomark load put} ifelse % /surl "start url" marks the beginning of a text sequence to be urled. % It also paints the text blue... /surl {mark /blue cvx 0.33 /setgray cvx % change text to blue /currentpoint cvx % remember box start /urly /exch cvx /store cvx /urlx /exch cvx /store cvx ] cvx % complete deferred command printlist exch 3 index exch put % stuff into gonzo printlist exch 1 add exch % increment gonzo list count } def /su {font3 surl} def % shorthand % /eurl "end url" unmarks the end of a text sequence and sets up % the pdfmark needed to define the Acrobat web link. /eurl {mark % start deferred proc exch % position url string % /black cvx 0 /setgray cvx % turn blue marker off % maintextcolor /setrgbcolor cvx % reset to main text color??? /aqua cvx /black cvx /makeurl cvx % defer call of url builder ] cvx % complete deferred proc printlist exch 3 index exch % stuff into gonzo printlist put exch 1 add exch % increment gonzo list count } def % /makeurl generates the pdfmark, receiving a {(urlstring) makeurl}. % Note that it is not called until formatted printlist time... /urlover 0.2 def % fraction of hot area over bounds /makeurl { /cururlname exch store % save the url string mark % start pdfmark currentfont /ScaleMatrix get 3 get /fsize exch store % guess height /Rect [ urlx fsize urlover mul sub % set box left x urly fsize urlover mul sub % set box left y currentpoint exch fsize urlover mul add exch fsize add ] /Border [ 0 0 0] % [0 0 0 ] = none; [0 0 2] = debug /Color [ .7 0 0 ] /Action <> /Subtype /Link /ANN % annotation type pdfmark % call pdf operators } def % /makeurlx generates the box specific pdfmark, receiving % a {(urlstring) makeurl}. % Note that it is not called until formatted printlist time... /makeurlx { /cururlnamex exch store % save the url string mark % start pdfmark /Rect [ xpos % set box left x ypos 0.9 sub % set box left y xpos 2.8 add % box right x ypos 0.9 sub 2.8 add % box right y ] /Border [ 0 0 0] % [0 0 0 ] = none; [0 0 2] = debug /Color [ .7 0 0 ] /Action <> /Subtype /Link /ANN % annotation type pdfmark % call pdf operators } def % dictionary method << %zzzzz /mindist1 (http://www.tinaja.com/glib/mindist1.pdf) /magsn01 (http://www.tinaja.com/magsn01.asp) /msinprop (http://www.tinaja.com/glib/msinprop.pdf) /info01 (http://www.tinaja.com/info01.asp) /homepage (http://www.tinaja.com) /maildon (mailto:don@tinaja.com) >> {mark exch /eurl cvx ] cvx def} forall % color emphasis /tinton1 {mark 0.25 0.25 0.25 /setrgbcolor cvx] cvx printlist exch 3 index exch put exch 1 add exch} def /tinton1a {mark 0.5 /settint cvx 0.33 /setgray cvx] cvx printlist exch 3 index exch put exch 1 add exch} def /tinton1r {mark 0 /settint cvx 0.33 /setgray cvx] cvx printlist exch 3 index exch put exch 1 add exch} def /tintoff {mark 0 /setgray cvx] cvx printlist exch 3 index exch put exch 1 add exch} def /to {tinton1 font3} store % tinton emphasis /tx {tintoff font1} store % tintoff /staytint {0.25 0.25 0.25 setrgbcolor} store % grayout /staytint1r {0 settint 0.25 setgray} store % red /staytint1a {0.5 settint 0.33 setgray} store % aqua %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%% parameter dictionary %%%%%% /slideshowdict << % this dictionary determines the slide sequence /sequence [ /an_introduction_to_magic_sinewaves /magic_sinewaves_are /magic_sinewave_features /and_limitations /magic_sinewave_appearance /working_in_quadrants /typical_unfiltered_spectrum /typical_unfiltered_spectrum_FLASH /magic_sinewave_generation /note_that /two_important_magsine_types /key_magsine_secret_I /key_magsine_secret_II /key_magsine_secret_III /fourier_pulse_properties /the_magic_equations /equation_simplification /equation_solution % /amplitude_adjustment % deleted by new calculator /quantization /clocking_frequencies /how_big_should_n_be /for_additional_help /this_has_been ] /gridsize 10 store % default layout grid size = 10 /slidewide 44 % total display width in grid units /slidehigh 33 % total display height /borderwide 2.5 % width of white vertical edges /borderhigh 2.5 % width of white horizontal edges /includeborder false % provide white border? /normalbackground /burpbackmain % name of main background proc /introbackground /burpbackintro % name of intro background proc /fontsused /burpfonts % name of font set used /patstrings /burppatstrings % name of patterns used /titx 6 % x grid position of title /tity 28.75 % y grid position of title /bodx 6 % x grid position of body /body 24 % y grid position of body /ivoryrndcolor [230 230 205 40] % random pattern colors [red blue green variance ] /magentarndcolor [230 100 230 120] /magentaaccent [0.65 0.05 0.65 ] % title accent slash color [red blue green] >> def slideshowdict begin % open slide show dictionary %%%%%%%%%%%%%%%%% style catalogs %%%%%%%%%%%%%%%%%% % burp is a mottled gray body with random magenta splotch and stripe /burpfonts { /cstretch 0.010 store /sstretch 0.010 store /kern 0.1 store /font0 /StoneSans-Bold 1.8 gonzofont % body titles /font1 /StoneSerif 1.35 gonzofont % normal body /font2 /StoneSerif-Bold 1.20 gonzofont % boxed subseries /font3 /StoneSerif-Bold 1.35 gonzofont % bold body /font4 /StoneSerif-Bold 1.25 gonzofont % smaller font3 for numerals /font5 /StoneSerif-Bold 1.85 gonzofont % oversize for math /font6 /StoneSans-Bold 2.8 gonzofont % titleslide oversize /font8 /StoneSerif-Bold 1 gonzofont % fine print copyright /font9 /ZapfDingbats 1.05 gonzofont % black boxes /font: /StoneSerif-Bold [2 0 0 2 0 -.5] gonzofont % special math * /font; /StoneSerif-Bold [1.4 0 0 1.4 0 .9] gonzofont % fake degrees * /titlefont {font0 }store % define title font /bodyfont {font1} store % defint body font /bodysubfont {font2}store % define bodysubfont /bodytxwide {/txtwide 35.5 store}store /bodyyinc {/yinc 2 store} store } store /burpbackmain { includeborder {borderwide 10 mul borderhigh 10 mul}{0 0} ifelse gridsize setgrid % set grid scale save /snap1 exch store % show the body background bodypatdict matrix % Identity matrix makepattern % Instantiate the pattern /bodypat exch def 0 0 % for the actual slide size slidewide slidehigh /Pattern setcolorspace bodypat setcolor rectfill % Fill rectangle with pattern snap1 restore save /snap1 exch store % show the accent accentpatdict matrix % Identity matrix makepattern % Instantiate the pattern /accentpat exch def 0 slidehigh 13.5 sub % splotch size 4.5 13.5 /Pattern setcolorspace accentpat setcolor rectfill % Fill rectangle with pattern snap1 restore % black outline black line1 0 0 slidewide slidehigh 0.0 setgray rectstroke % Stroke original black outline % accent lines gsave magentaaccent aload pop setrgbcolor 0.7 setlinewidth 1 setlinecap 2 27.5 mt slidewide 4.5 sub r 0 setlinecap 0 27.5 mt 3 r 0.45 setlinewidth 1 setlinecap slidewide 13 sub 2.5 mt 12 r slidewide 2.5 mt 0 setlinecap 2 l grestore fontsused cvx exec % set fonts for normal slide by name } store /burpbackintro { includeborder {borderwide 10 mul borderhigh 10 mul}{0 0} ifelse gridsize setgrid % set grid scale save /snap1 exch store % show the body background bodypatdict matrix % Identity matrix makepattern % Instantiate the pattern /bodypat exch def 0 0 % for the actual slide size slidewide slidehigh /Pattern setcolorspace bodypat setcolor rectfill % Fill rectangle with pattern snap1 restore save /snap1 exch store % show the accent accentpatdict matrix % Identity matrix makepattern % Instantiate the pattern /accentpat exch def 5.5 16.5 33 12 /Pattern setcolorspace accentpat setcolor rectfill % Fill rectangle with pattern snap1 restore % black outline black line1 0 0 slidewide slidehigh 0.0 setgray rectstroke % Stroke original black outline % accent lines gsave magentaaccent aload pop setrgbcolor 0.35 setlinewidth 1 setlinecap 1 setlinejoin 5.5 16.5 0.8 sub mt 13.6 pu -.8 -.8 rlineto 34.6 pr -.8 .8 rlineto 13.6 pd .8 .8 rlineto 34.6 pl closepath stroke 0.35 setlinewidth 1 setlinecap 1 setlinejoin 0 3 mt 12 pr 1.4 pu 20 pr 2.8 pd 20 pl 1.4 pu 1.4 pd 20 pr 1.4 pu 12 pr stroke grestore fontsused cvx exec % set fonts for normal slide by name } store /burppatstrings { ivoryrndcolor buildpixels makeimagestring /bodypatstring exch store magentarndcolor buildpixels makeimagestring /accentpatstring exch store } store %%%%%%%%%%%%%%% pattern utilities %%%%%%%%%%%%%%%%%% /DeviceRGB setcolorspace % pick color model /hpixels 50 store % size of pattern image /vpixels 50 store /issize hpixels vpixels mul store % makestring converts a stack top array into a string... /makestring {dup length string dup /NullEncode filter 3 -1 roll {1 index exch write} forall pop} def % /buildpixels makes three nearby colors given [r b g texture] all 0-255 integers /buildpixels {aload pop /texture exch store /b0 exch store /g0 exch store /r0 exch store 123 srand /r1 r0 texture random texture 2 div sub add cvi dup 255 ge {pop 255}if dup 0 lt {pop 0} if store /g1 g0 texture random texture 2 div sub add cvi dup 255 ge {pop 255}if dup 0 lt {pop 0} if store /b1 b0 texture random texture 2 div sub add cvi dup 255 ge {pop 255}if dup 0 lt {pop 0} if store /r2 r0 texture random texture 2 div sub add cvi dup 255 ge {pop 255}if dup 0 lt {pop 0} if store /g2 g0 texture random texture 2 div sub add cvi dup 255 ge {pop 255}if dup 0 lt {pop 0} if store /b2 b0 texture random texture 2 div sub add cvi dup 255 ge {pop 255}if dup 0 lt {pop 0} if store /r3 r0 texture random texture 2 div sub add cvi dup 255 ge {pop 255}if dup 0 lt {pop 0} if store /g3 g0 texture random texture 2 div sub add cvi dup 255 ge {pop 255}if dup 0 lt {pop 0} if store /b3 b0 texture random texture 2 div sub add cvi dup 255 ge {pop 255}if dup 0 lt {pop 0} if store } store % /makeimagestring creates a sting usable for a pattern image /makeimagestring { 12345 srand % make repeatable /iarray mark issize { r1 g1 b1} repeat ] store % fill all with color 1 issize 2 div cvi { iarray issize % fill half with color 2 random 3 mul cvi [ r2 g2 b2 ] putinterval} repeat issize 2 div cvi { iarray issize % fill third with color 3 random 3 mul cvi [ r3 g3 b3 ] putinterval} repeat iarray makestring } store % /rndimage shows the random string as a patternable image /bodyrandimage { gsave 5 dup scale << % start image dicationary /ImageType 1 % always one /Width hpixels % width in pixels /Height vpixels % height in pixels /ImageMatrix [hpixels 0 0 vpixels neg 0 vpixels ] /DataSource bodypatstring % proc to get string data /BitsPerComponent 8 % color resolution /Decode [0 1 0 1 0 1] % per red book 4.10 >> image % call the image grestore } def /accentrandimage { gsave 5 dup scale << % start image dicationary /ImageType 1 % always one /Width hpixels % width in pixels /Height vpixels % height in pixels /ImageMatrix [hpixels 0 0 vpixels neg 0 vpixels ] /DataSource accentpatstring % proc to get string data /BitsPerComponent 8 % color resolution /Decode [0 1 0 1 0 1] % per red book 4.10 >> image % call the image grestore } def % using a separate pattern dictionary for each pattern... /bodypatdict << /PatternType 1 % Tiling pattern /PaintType 1 % Colored /TilingType 1 /BBox [0 0 50 50] /XStep 5 /YStep 5 /PaintProc { begin bodyrandimage end} >> store /accentpatdict << /PatternType 1 % Tiling pattern /PaintType 1 % Colored /TilingType 1 /BBox [0 0 50 50] /XStep 5 /YStep 5 /PaintProc { begin accentrandimage end} >> store % /makepatternstrings generates the needed patterns /makepatternstrings { [230 210 190 80] buildpixels makeimagestring /accentpatstring exch store [230 100 230 120] buildpixels makeimagestring /bodypatstring exch store } store %%%%%%%% end pattern utils %%%%%%%% %%%%%%% service utilities %%%%% /makeslideshow {setupshow sequence { save /snapxx exch store cvx exec showpage snapxx restore} forall } store /settitle { titlefont gsave 0.25 0.25 0.25 setrgbcolor titx exch tity exch cl grestore} store /setbody { bodyfont bodytxwide bodyyinc bodx exch body exch cl} store % /setupshow first locks out pdfmark from a printer, then sets % the page mode. /setupshow { /pdfmark where {pop}{userdict /pdfmark /cleartomark load put} ifelse [/CropBox [0 0 slidewide includeborder {borderwide 2 mul add} if gridsize mul slidehigh includeborder {borderhigh 2 mul add} if gridsize mul ] % set the wierd size /PAGES pdfmark [ {Catalog} << /ViewerPreferences << /FitWindow true /CenterWindow true >> /PageLayout /SinglePage % no rolling /Pagemode /FullScreen % fullscreen if not on web /View [/XYZ null null 1 ] % force 100% >> /PUT pdfmark % then makes background pattern strings ONCE for later access patstrings cvx exec % get patterns from style area } def %%%%%% background generators %%%%%%%% /setbackground { normalbackground cvx exec } store % link selected background /settitlebackground { introbackground cvx exec } store %%%%%%% individual slide data %%%%%%%% /an_introduction_to_magic_sinewaves { settitlebackground 1 1 1 setrgbcolor /yinc 3 store slidewide 2 div 23 (|6An Introduction|j|j\nto Magic Sinewaves|j|j) cc 0.25 0.25 0.25 setrgbcolor /yinc 2 store slidewide 2 div 11 (|3By Don Lancaster \nand Synergetics) cc slidewide 2 div 2.65 (|4 |/su http://www.tinaja.com|/homepage |j|j|j) cc } store /magic_sinewaves_are { setbackground (Magic Sinewaves are\274) settitle /tabs [4 0 0 ]store (A new class of mathematical functions that promise to significantly improve the efficient generation of power digital sinewaves for\274 |h|/staytint |t|9n|4 AC motor speed controls |t|9n|4 Electric vehicles |t|9n|4 Power quality conditioners |t|9n|4 Telephony & datacomm |t|9n|4 Solar energy conversion |t|9n|4 400 Hertz Aerospace apps |t|9n|4 Battery Powered Inverters ) setbody } store /magic_sinewave_features { setbackground (Magic Sinewave Features\274) settitle /stretchyinc {/yinc 2.4 store} store /tabs [0 2.5 0 0 ]store (|h|/staytint |/stretchyinc |t|9n|4 Fewest switch events for highest efficiency. |t|9n|4 Any chosen number of low harmonics are |/tinton1r zero|/tx |4|j. |t|9n|4 All digital and highly low end micro friendly. |t|9n|4 As few as seven values stored per amplitude. |t|9n|4 Precise control of amplitude and frequency. |t|9n|4 Can be made fully three phase compatible. |t|9n|4 Half-bridge switching events for low loss. ) setbody } store /and_limitations { setbackground (And Limitations\274) settitle /stretchyinc {/yinc 2.6 store} store /tabs [0 2 0 0 ]store (|h|/staytint |/stretchyinc |t|9n|4 Generation must be precise. |t|9n|4 Some output filtering is required. |t|9n|4 Load matching is recommended. |t|9n|4 Wide speed range does not extend to dc. |t|9n|4 Best suited for low audio frequencies. |t|9n|4 First two uncontrolled harmonics are large. ) setbody } store /magic_sinewave_appearance { setbackground (Magic Sinewave Appearance \274) settitle ( ) setbody % figure only no text /p1s 11.086 store % best efficiency leans /p1e 12.913 store /p2s 22.211 store /p2e 25.788 store /p3s 33.416 store /p3e 38.583 store /p4s 44.733 store /p4e 51.266 store /p5s 56.192 store /p5e 63.807 store /p6s 67.819 store /p6e 76.180 store /p7s 79.628 store /p7e 88.371 store % redo as normal { /p1s 6.856 store /p1e 7.872 store /p2s 17.735 store /p2e 20.662 store /p3s 29.222 store /p3e 33.995 store /p4s 41.001 store /p4e 47.463 store /p5s 53.096 store /p5e 61.017 store /p6s 65.576 store /p6e 74.624 store /p7s 78.496 store /p7e 88.183 store } pop /hh {32 mul 90 div 0.78 mul } store /uu 12.5 store /posninc 90 7.5 div store /msinplot {gsave translate 0.5 0 0.5 setrgbcolor line1 gsave % [{0 12 moveto 0.8 u} posninc hh 8] xrpt grestore 0 0 mt p1s hh pr uu pu p1e p1s sub hh pr uu pd p2s p1e sub hh pr uu pu p2e p2s sub hh pr uu pd p3s p2e sub hh pr uu pu p3e p3s sub hh pr uu pd p4s p3e sub hh pr uu pu p4e p4s sub hh pr uu pd p5s p4e sub hh pr uu pu p5e p5s sub hh pr uu pd p6s p5e sub hh pr uu pu p6e p6s sub hh pr uu pd p7s p6e sub hh pr uu pu p7e p7s sub hh pr uu pd 90 p7e sub hh pr gsave 0 0.83 0.83 setrgbcolor fill grestore line3 1 setlinecap 1 setlinejoin 0 0.33 0.33 setrgbcolor stroke grestore} store /appcut { gsave translate % 25 15 showgrid % uncomment to view 0 0 msinplot font5 0 0.33 0.33 setrgbcolor 0 -2.7 (|50|;o|5) cc 25.45 -2.7 (90|;o|5) cc grestore } store 9.5 9 appcut } store /working_in_quadrants { setbackground (Working in Quadrants\274) settitle /tabs [4 0 0 ]store (Normally, only the first quadrant of a magic sinewave is generated. This is then mirrored or reflected to form the full sinewave. The first quadrant design benefits include\274 |h|/staytint |t|9n|4 No even harmonics. |t|9n|4 No odd cosine harmonics. |t|9n|4 No dc term. |t|9n|4 One quarter the data storage. |t|9n|4 Much faster analysis. ) setbody } store /typical_unfiltered_spectrum { setbackground (Typical Unfiltered Spectrum\274) settitle ( ) setbody /spectrumplot {gsave translate 0.87 dup scale % compress slightly % 33 13 showgrid % uncomment to view gsave [{0 0 mt 0.3 d} 2 19] xrpt grestore gsave line1 [{-0.4 3 mt 36.9 r} 3 5] yrpt grestore 36.5 0 mt 15 u 0 1 1 setrgbcolor 0 setlinecap line1 0.5 0 mt 15 pu 1 pr 15 pd gsave closepath fill grestore 0 0.33 0.33 setrgbcolor stroke 1 0 1 setrgbcolor 28.5 0 mt 2.5 pu 1 pr 2.5 pd gsave closepath fill grestore 0.33 0 0.33 setrgbcolor stroke 1 0 1 setrgbcolor 30.5 0 mt 3.4 pu 1 pr 3.4 pd gsave closepath fill grestore 0.33 0 0.33 setrgbcolor stroke 1 0 1 setrgbcolor 32.5 0 mt 0.3 pu 1 pr 0.3 pd gsave closepath fill grestore 0.33 0 0.33 setrgbcolor stroke 1 0 1 setrgbcolor 34.5 0 mt 0.5 pu 1 pr 0.5 pd gsave closepath fill grestore 0.33 0 0.33 setrgbcolor stroke black % /font1 /Helvetica 0.8 gonzofont font1 /yinc 2 store font8 gsave 1.6 -0.9 translate 90 rotate black 0 0 (fundamental 3 5 7 9 1|k1 1|k3 1|k5 1|k7 1|k9 2|k1 23 25 27 29 3|k1 33 35) cr grestore 15 -4 (HARMONIC NUMBER) cl -1 -0.3 (0.0) cr -1 2.7 (0.2) cr -1 5.7 (0.4) cr -1 8.7 (0.6) cr -1 11.7 (0.8) cr -1 14.7 (1.0) cr gsave -3.7 4.5 translate 90 rotate black 0 0 (AMPLITUDE) cl grestore black line3 0 0 mt -.5 0 mt 37 r 0 -.5 mt 16 u black 23 13.2 ((|jbest efficiency n|j=|j28|j)) cl % flashtext font3 1 0 0 setrgbcolor % 15 6.65 (All Intermediate\nHarmonics are ZERO|j!!!) cc grestore } store 10 10 spectrumplot } store /typical_unfiltered_spectrum_FLASH { setbackground (Typical Unfiltered Spectrum\274) settitle ( ) setbody /spectrumplot {gsave translate 0.87 dup scale % compress slightly % 33 13 showgrid % uncomment to view gsave [{0 0 mt 0.3 d} 2 19] xrpt grestore gsave line1 [{-0.4 3 mt 36.9 r} 3 5] yrpt grestore 36.5 0 mt 15 u 0 1 1 setrgbcolor 0 setlinecap line1 0.5 0 mt 15 pu 1 pr 15 pd gsave closepath fill grestore 0 0.33 0.33 setrgbcolor stroke 1 0 1 setrgbcolor 28.5 0 mt 2.5 pu 1 pr 2.5 pd gsave closepath fill grestore 0.33 0 0.33 setrgbcolor stroke 1 0 1 setrgbcolor 30.5 0 mt 3.4 pu 1 pr 3.4 pd gsave closepath fill grestore 0.33 0 0.33 setrgbcolor stroke 1 0 1 setrgbcolor 32.5 0 mt 0.3 pu 1 pr 0.3 pd gsave closepath fill grestore 0.33 0 0.33 setrgbcolor stroke 1 0 1 setrgbcolor 34.5 0 mt 0.5 pu 1 pr 0.5 pd gsave closepath fill grestore 0.33 0 0.33 setrgbcolor stroke black % /font1 /Helvetica 0.8 gonzofont font1 /yinc 2 store font8 gsave 1.6 -0.9 translate 90 rotate black 0 0 (fundamental 3 5 7 9 1|k1 1|k3 1|k5 1|k7 1|k9 2|k1 23 25 27 29 3|k1 33 35) cr grestore 15 -4 (HARMONIC NUMBER) cl -1 -0.3 (0.0) cr -1 2.7 (0.2) cr -1 5.7 (0.4) cr -1 8.7 (0.6) cr -1 11.7 (0.8) cr -1 14.7 (1.0) cr gsave -3.7 4.5 translate 90 rotate black 0 0 (AMPLITUDE) cl grestore black line3 0 0 mt -.5 0 mt 37 r 0 -.5 mt 16 u black 23 13.2 ((|jbest efficiency n|j=|j28|j)) cl % flashtext font3 1 0 0 setrgbcolor 15 6.65 (All Intermediate\nHarmonics are ZERO|j!!!) cc grestore } store 10 10 spectrumplot } store /magic_sinewave_generation { setbackground (Magic Sinewave Generation\274) settitle ( ) setbody /box3x5 {gsave /btxt exch store translate -2.5 -1.5 mt 3 pu 5 pr 3 pd closepath gsave 0.5 1 1 setrgbcolor fill grestore line3 0 0.33 0.33 setrgbcolor stroke font4 0 -0.4 btxt cc grestore} def /spst {gsave translate line3 0 setlinecap 0 setlinejoin 0.2 setlinewidth 0 0.33 0.33 setrgbcolor 0 0 mt 2 1 rlineto stroke black 0 0 mt circ1 2 -1 mt circ1 2 1 mt circ1 grestore} def /spst- {gsave translate -1 -1 scale 0 0 spst grestore} store /genplot {gsave translate 1.3 dup scale % 33 13 showgrid % uncomment to view line3 black /ground {1 setlinecap -.4 0 rmoveto 0.8 0 rlineto -.65 -0.25 rmoveto .5 0 rlineto -0.35 -0.25 rmoveto .2 0 rlineto stroke} def % for heavier than usual 11.5 4 mt 2 r 6.5 4 mt 2 l 18.5 4 mt 2 r 2.5 5 mt 1 l 3.5 u 22 r 3.5 d 1 l 12.5 8.5 mt dot 12.5 8.5 mt 1.5 u circ1 0 0.33 0.33 setrgbcolor font4 12.5 10.7 (+|jd|jc|j|j) cc black 2.5 3 mt 1 l 1.5 d ground 22.5 3 mt 1 r 1.5 d ground 20.5 4 spst 4.5 4 spst- 9 4 (Filter) box3x5 16 4 (Load) box3x5 grestore } store 7 8 genplot } store /note_that { setbackground (Note that\274) settitle /tabs [2.5 0 0 ]store % 4 is normal (The magic sinewave synthesis process |/tinton1r |3guarantees|1|/tx maximum low harmonic rejection for any given number of switching events. |h When compared to classic PWM\274 |h|/staytint |t|9n|4 There are far fewer switching events. |t|9n|4 Events are half bridge for lower loss. ) setbody } store /two_important_magsine_types { setbackground (Two Important MagSine Types\274) settitle /tabs [4 0 0 ]store % 4 is normal (|3|/tinton1a Best Efficiency: |h|2|/staytint |t|9n|4 Zeros out first n harmonics. |t|9n|4 n|j/|j2 values stored per amplitude. |t|9n|4 Single phase only. |h|/black |3|/tinton1a Delta Friendly: |h|2|/staytint |t|9n|4 Zeros first (|j3n|j/|j4|j) + 1 harmonics. |t|9n|4 n|j/|j4 values stored per amplitude. |t|9n|4 Fully three phase compatible. ) setbody } store /key_magsine_secret_I { setbackground (The Key MagSine Secret (|j|jI|j|j)|j\274) settitle (By way of an esoteric math transform\274 |h \274Each quadrant pulse edge (indirectly) performs |/tinton1r |3one|/tx useful task. Thus providing you the maximum possible efficiency by minimizing switch events. ) setbody /biarrow {gsave translate 0 0 mt 1 2 rlineto 1 pd 2 pr 1 pu 1 -2 rlineto -1 -2 rlineto 1 pu 2 pl 1 pd closepath 0.83 0 0.83 setrgbcolor fill grestore} store /pulsecut { gsave translate % 15 15 showgrid 0 .55 .55 setrgbcolor 0.5 setlinewidth 1 setlinecap 0 0 mt 3 pr 7.8 pu 6 pr 7.8 pd 3 r 1 4 biarrow 7 4 biarrow grestore } store 14.5 14 pulsecut } store /key_magsine_secret_II { setbackground (Key MagSine Secret (|j|jII|j|j)|j\274) settitle ( |/to ( Example #1 )|/tx |h On a “best efficiency” 28 Magic Sinewave, there are |/to fourteen|/tx first quadrant pulse edges. |h One edge sets the amplitude. Thirteen edges zero out harmonics |/to |43|/tx , |/to |45|/tx , |/to |47|/tx , |/to |49|/tx , |/to |411|/tx , |/to |413|/tx , |/to |415|/tx , |/to |417|/tx , |/to |419|/tx , |/to |421|/tx , |/to |423|/tx , |/to |425|/tx , and |/to |427|/tx . |h|1 Unfiltered harmonics |/to |429|/tx and |/to |431|/tx will be fairly strong, but always will be less than the fundamental. ) setbody } store /key_magsine_secret_III { setbackground (The Key MagSine Secret (|j|jIII|j|j)|j\274) settitle ( |/to ( Example #2 )|/tx |h On a “delta friendly” 28 Magic Sinewave, there are |/to fourteen|/tx first quadrant pulse edges. |h One edge sets the amplitude. Seven edges zero out all triad harmonics |/to |43|/tx , |/to |49|/tx , |/to |415|/tx , |/to |421|/tx , |/to |427|/tx \274 and will guarantee three phase compatibility through |/to edge tracking|/tx . |h Six edges zero harmonics |/to |45|/tx , |/to |47|/tx , |/to |411|/tx , |/to |413|/tx , |/to |417|/tx , & |/to |419|/tx . Harmonics |/to |423|/tx and |/to |425|/tx will be fairly strong. ) setbody } store /fourier_pulse_properties { setbackground (Fourier Pulse Properties\274) settitle /tabs [-2 0 0 ]store (Given a unity height first quadrant pulse starting at angle |/to p1s|/tx and ending at an angle of |/to p1e|/tx , its fundamental amplitude contribution will be\274 |/tinton1a |t|5cos|j(1|:*|5p1s) - cos|j(1|:*|5p1e) = ampl|j|:*|5|jpi/4 |h |1And its harmonic |/to j|/tx contribution will be\274 |/tinton1a |t|5cos|j(j|:*|5p1s) - cos|j(j|:*|5p1e) = ampl|j|:*|5|jpi/4j ) setbody } store /the_magic_equations { setbackground (The Magic Equations\274) settitle /wider {/txtwide 400 store /yinc 1.75 store /ypos ypos 0.5 add store} store ((|jshown for best efficiency Magic Sinewave |/to |4"|jn|j=|j20|j"|/tx |j) |8|/wider |/staytint1a cos|j( 1*p1s )|j-|jcos|j(1* p1e )|j+|j\274|j+|jcos|j( 1*p5s )|j-|jcos|j( 1*p5e ) = ampl|j*|jpi/4 cos|j( 3*p1s )|j-|jcos|j( 3*p1e )|j+|j\274|j+|jcos|j( 3*p5s )|j-|jcos|j( 3*p5e ) = 0 cos|j( 5*p1s )|j-|jcos|j( 5*p1e )|j+|j\274|j+|jcos|j( 5*p5s )|j-|jcos|j( 5*p5e ) = 0 cos|j( 7*p1s )|j-|jcos|j( 7*p1e )|j+|j\274|j+|jcos|j( 7*p5s )|j-|jcos|j( 3*p5e ) = 0 cos|j( 9*p1s )|j-|jcos|j( 9*p1e )|j+|j\274|j+|jcos|j( 9*p5s )|j-|jcos|j( 3*p5e ) = 0 cos|j(11*p1s)|j-|jcos|j(11*p1e)|j+|j\274|j+|jcos|j(11*p5s)|j-|jcos|j(11*p5e)|j = 0 cos|j(13*p1s)|j-|jcos|j(13*p1e)|j+|j\274|j+|jcos|j(13*p5s)|j-|jcos|j(13*p5e)|j = 0 cos|j(15*p1s)|j-|jcos|j(15*p1e)|j+|j\274|j+|jcos|j(15*p5s)|j-|jcos|j(15*p5e)|j = 0 cos|j(17*p1s)|j-|jcos|j(17*p1e)|j+|j\274|j+|jcos|j(17*p5s)|j-|jcos|j(17*p5e)|j = 0 cos|j(19*p1s)|j-|jcos|j(19*p1e)|j+|j\274|j+|jcos|j(19*p5s)|j-|jcos|j(19*p5e)|j = 0 ) setbody } store /equation_simplification { setbackground (Equation Simplification\274) settitle (These equations can be dramatically simplified by noting that trig multi-angles are really one common form of |/to Chebycheff polynominal|/tx . |h A most interesting property of many Chebycheff polynominals is that when they are really good at something, they are often the best possible. |h Thus driving the Cheby to the Levy.) setbody } store /equation_solution { setbackground % modified from original for new calculators (Equation Solution\274) settitle (These equations can be elegantly solved by using |/su These JavaScript Calculators|1|/magsn01 , in a variation of |/to Newton's Method|/tx . |h A guess is made to get you near a trial solution. Additional passes are then made to significantly improve the previous result. |h The process rapidly converges to an exact desired amplitude and precise zero harmonics.) setbody } store /amplitude_adjustment { setbackground % deleted from original by update (Amplitude Adjustment\274) settitle (When a zero harmonic magic sinewave solution is found, the final amplitude may not be exact. |h This is corrected by asking for a slightly larger or a slightly smaller amplitude. |h For instance, if you want |/to |4.400|/tx and get |/to |4.396|/tx , ask for |/to |4.404|/tx instead. Convergence is often rapid.) setbody } store /quantization { setbackground (Quantization\274) settitle /adjtxt {/txtwide txtwide 1 add store} store (Exact magic sinewave solutions require |/to extreme|/tx math accuracy. Quantization effects will raise the harmonics to low rather than zero values. |h |/adjtxt Very often, ten bits of timing info will give "acceptable" results, while twelve bits should yield "good" results. |h Some |/su "smoke and mirror" techniques"|1|/mindist1 may be needed to allow eight bit timing storage.) setbody } store /how_big_should_n_be { setbackground (How Big Should "n" Be?) settitle (For most uses most of the time, a best efficiency or delta friendly |/to n |k=|k |428|/tx will be optimum. This will zero up to |/to |428|/tx harmonics using as few as |/to seven|/tx values of table lookup storage per amplitude. |h Very large values of |/to "|jn|j"|/tx will require more switch events but allow very wide speed ranges, may reduce audio whine, greatly ease filtering, and still provide benefits over classic PWM. |h Zeroing |/to several thousand|/tx harmonics is possible|j!) setbody } store /clocking_frequencies { setbackground (Clocking Frequencies\274) settitle (Many events have to sequentially take place to properly generate a Magic Sinewave. The number and precision of the events sets the clocking rate. |h Typically, a |/to |44|3 MegaHertz|/tx clocking gives useful |/to |460|3 Hertz|/tx Magic Sinewaves. |h It is often best to separate the frequency setting from the actual Magic Sinewave generation.) setbody } store /for_additional_help { setbackground (For Additional Help\274) settitle /txtwide 400 store (|h Magic Sinewave |/to calculators|/tx and tutorial\274 |h |/su http://www.tinaja.com/magsn01.asp|1|/magsn01 |h Magic Sinewave |/to development|/tx proposal\274 |h |/su http://www.tinaja.com/glib/msinprop.pdf|1|/msinprop |h Magic Sinewave |/to seminars|/tx and consulting\274 |h |/su http://www.tinaja.com/info01.asp|1|/info01 ) setbody } store /newyinc {/yinc 1.25 store /xpos xpos 1 sub store} store /this_has_been { setbackground (This has been\274) settitle ( \274|j|ja presentation by Don Lancaster and |/to Synergetics|/tx , 3860 West First Street, Box 809, Thatcher, Arizona, 85552. (928) 428-4073. |h |/su mailto:don@tinaja.com|1|/maildon |h |h|/staytint1r |/newyinc |8Copyright c 2003 and earlier by Don Lancaster and Synergetics. Linking usually welcome. All media, web, and ALL other rights fully reserved. Mirroring or reposting is expressly forbidden.) setbody } store %%%%%%%%% main loop %%%%%%% makeslideshow % this does it all % EOF