by Jacob Pech
forked from adom/amfm-receiver-moleculeup to date
USB-powered AM/FM receiver on an Adom Molecule: discrete BJT and op-amp superhet (10.7 MHz and 455 kHz IFs), STM32G0B1 tuning, self-calibration and USB audio over one USB-C cable. 96 x 96 mm pin grid, 4 layers, KiCad 10.
main
noah
amfm-receiver-molecule: readme.html: the explorer decluttered: the essentials open, the rest one click away
70c317c
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>AM/FM Receiver Molecule</title>
<script>try { localStorage.length; } catch (e) { (function () { var m = {}; Object.defineProperty(window, "localStorage", { value: { getItem: function (k) { return k in m ? m[k] : null; }, setItem: function (k, v) { m[k] = String(v); }, removeItem: function (k) { delete m[k]; }, clear: function () { m = {}; } } }); })(); }</script>
<style>
@font-face { font-family: 'Familjen Grotesk'; src: url(https://wiki.adom.inc/static/fonts/familjen-grotesk-700.woff2) format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Familjen Grotesk'; src: url(https://wiki.adom.inc/static/fonts/familjen-grotesk-500.woff2) format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Satoshi'; src: url(https://wiki.adom.inc/static/fonts/satoshi-400.woff2) format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Satoshi'; src: url(https://wiki.adom.inc/static/fonts/satoshi-500.woff2) format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'JetBrains Mono'; src: url(https://wiki.adom.inc/static/fonts/jetbrains-mono-400.woff2) format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'JetBrains Mono'; src: url(https://wiki.adom.inc/static/fonts/jetbrains-mono-500.woff2) format('woff2'); font-weight: 500; font-display: swap; }
/* the wiki's own README look (its tokens and .readme rules), so this page reads like every other page */
:root {
color-scheme: dark;
--bg: #0d1117; --bg-2: #161b22; --bg-3: #1c2128; --text: #e6edf3; --text-2: #8b949e; --accent: #00b8b1; --accent-bright: #00e6dc;
--border: #30363d; --radius: 6px;
--font-display: 'Familjen Grotesk', -apple-system, 'Segoe UI', sans-serif;
--font-body: 'Satoshi', -apple-system, 'Segoe UI', 'Noto Sans', sans-serif;
--font-mono: 'JetBrains Mono', SFMono-Regular, Consolas, 'Liberation Mono', Menlo, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font: 14px/1.7 var(--font-body); -webkit-font-smoothing: antialiased; font-synthesis: none; overflow-wrap: break-word; }
.doc { padding: 0 2px 24px; }
h1, h2, h3, h4, h5, h6 { font-family: var(--font-display); font-weight: 700; line-height: 1.3; color: var(--text); text-wrap: balance; }
h1 { font-size: 2em; margin: 8px 0 16px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
h2 { font-size: 1.55em; margin: 28px 0 12px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
h3 { font-size: 1.3em; margin: 22px 0 10px; }
h4 { font-size: 1.1em; margin: 16px 0 8px; }
p { margin: 0 0 16px; }
ul, ol { margin: 0 0 16px; padding-left: 2em; }
li { margin-bottom: 4px; }
li > ul, li > ol { margin: 4px 0 0; }
a { color: var(--accent); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--accent-bright); text-decoration: underline; }
img { max-width: 100%; border-radius: var(--radius); }
img.zoom { cursor: zoom-in; }
table { width: 100%; border-collapse: collapse; margin: 0 0 16px; }
th, td { padding: 8px 12px; border: 1px solid var(--border); text-align: left; vertical-align: top; }
th { background: var(--bg-3); font-weight: 500; }
td img { border-radius: 4px; }
code, pre { font-family: var(--font-mono); font-size: .875em; }
code { background: var(--bg-3); padding: 2px 6px; border-radius: 4px; }
pre { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; overflow-x: auto; line-height: 1.5; margin: 0 0 16px; }
pre code { background: none; padding: 0; font-size: inherit; }
blockquote { padding: 8px 16px; margin: 0 0 16px; border-left: 3px solid var(--accent); color: var(--text-2); background: var(--bg-3); border-radius: 0 var(--radius) var(--radius) 0; }
hr { border: none; border-top: 1px solid var(--border); margin: 24px 0; }
em { color: var(--text); }
:focus-visible { outline: 2px solid var(--accent-bright); outline-offset: 2px; }
adom-verified { display: block; margin: 0 0 8px; }
adom-amfm-explorer { display: block; margin: 8px 0 28px; }
.scroll-x { overflow-x: auto; }
details.fold > summary { list-style: none; cursor: pointer; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary h2 { display: flex; align-items: center; gap: 8px; }
details.fold > summary .chev { width: 18px; height: 18px; flex: none; margin-left: auto; color: var(--text-2); transform: rotate(-90deg); transition: transform .15s ease, color .15s ease; }
details.fold[open] > summary .chev { transform: none; }
details.fold > summary:hover .chev { color: var(--accent-bright); }
details.fold:not([open]) > summary h2 { color: var(--text-2); }
table.parts td { padding: 6px 10px; }
table.parts td:first-child { min-width: 240px; }
table.parts td:first-child > a:first-child { float: left; margin: 0 12px 0 0; line-height: 0; }
table.parts td:first-child > a:first-child + br { display: none; }
table.parts td:first-child::after { content: ''; display: block; clear: both; }
</style>
</head>
<body>
<main class="doc">
<h1 id="amfm-receiver-molecule">AM/FM Receiver Molecule</h1>
<p>A USB-powered AM/FM broadcast receiver on an Adom Molecule: the radio is discrete transistors and op-amps, and an STM32G0B1 tunes it, calibrates it, and streams the audio to a PC over the same USB-C cable that powers it and updates its firmware.</p>
<p><adom-verified src="https://wiki.adom.inc/adom/amfm-receiver-molecule/render/verification.json"></adom-verified></p>
<h2 id="circuit-explorer">Circuit explorer</h2>
<p><adom-amfm-explorer band="fm"></adom-amfm-explorer></p>
<details class="fold" open><summary><h2 id="how-the-tuning-works">How the tuning works<svg class="chev" viewBox="0 0 24 24" aria-hidden="true"><path d="M8 10l4 4 4-4" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg></h2></summary>
<p>This is a <strong>superhet</strong>: instead of building a filter that slides across the whole band, the radio shifts whichever station you want down to one fixed frequency, the <strong>intermediate frequency (IF)</strong>, and does all its filtering and gain there. Tuning is just moving one oscillator.</p>
<p><strong>1. Mix the station down to 10.7 MHz.</strong> A transistor mixer multiplies the antenna signal by a local oscillator (LO). The product contains the difference frequency, so if the LO sits exactly 10.695 MHz above the station, that station lands at 10.695 MHz and the 10.7 MHz ceramic filters pass it while rejecting its neighbours.</p>
<div class="scroll-x"><table>
<thead>
<tr>
<th></th>
<th>FM</th>
<th>AM (medium wave)</th>
</tr>
</thead>
<tbody><tr>
<td>Antenna band</td>
<td>87.5 to 108 MHz</td>
<td>530 to 1700 kHz</td>
</tr>
<tr>
<td>Before the mixer</td>
<td>70 MHz high-pass + 130 MHz low-pass, plus an RF amplifier whose tank tracks the station</td>
<td>2 MHz low-pass</td>
</tr>
<tr>
<td>Local oscillator</td>
<td>98.7 to 118.7 MHz (Colpitts, Q302)</td>
<td>11.23 to 12.4 MHz (Clapp, Q402)</td>
</tr>
<tr>
<td>First IF</td>
<td>10.695 MHz</td>
<td>10.695 MHz (AM is converted <em>up</em>)</td>
</tr>
<tr>
<td>Second LO</td>
<td>10.240 MHz crystal (Y501)</td>
<td>the same crystal</td>
</tr>
<tr>
<td>Second IF</td>
<td>455 kHz</td>
<td>455 kHz</td>
</tr>
<tr>
<td>Detector</td>
<td>limiter + pulse-count discriminator</td>
<td>diode envelope detector with AGC</td>
</tr>
</tbody></table></div>
<p>Example: to hear <strong>101.1 MHz FM</strong>, the FM LO runs at 101.1 + 10.695 = <strong>111.795 MHz</strong>; for <strong>1010 kHz AM</strong>, the AM LO runs at 1.010 + 10.695 = <strong>11.705 MHz</strong>. Both bands then share the same 10.7 MHz filters and the second conversion to 455 kHz (10.695 minus 10.240), where the AM filter and the FM limiter do the rest.</p>
<p><strong>2. A voltage sets the oscillator frequency.</strong> Each LO resonates at f = 1 / (2π √(LC)), and part of its C is a <strong>BB910 varactor</strong>: a diode whose capacitance falls as its reverse voltage rises (35 to 45 pF at 0.5 V, 10 to 20 pF at 5 V). Raise the tuning voltage, the capacitance drops, the frequency goes up. The STM32's 12-bit DAC outputs 0 to 3.3 V, and a TLV9062 op-amp scales it by 1.45 to the 0 to 4.8 V tuning voltages <code>VT_FM</code> and <code>VT_AM</code>. On FM a third voltage, <code>VT_RF</code> (a filtered PWM), retunes the RF amplifier's own varactor tank to follow the station, which keeps the image 21.4 MHz above it out.</p>
<div class="scroll-x"><table><tr><td><img class="zoom" src="https://wiki.adom.inc/adom/amfm-receiver-molecule/render/docs/screens/tuning.jpg" width="100%" alt="Tuning section: varactor drive op-amps, RF tracking and band switch"></td></tr><tr><td><em>The tuning block: the TLV9062 varactor drivers (VTF, VTA), the RF-tracking filter (VTR) and the band switch.</em></td></tr></table></div>
<p><strong>3. The firmware calibrates itself.</strong> Varactors differ part to part and their curve is not linear, so the DAC code for a station is measured, not assumed. During <code>cal</code> the MCU puts a crystal-derived square wave (128 MHz divided by N) onto the antenna through 47 k and 100 pF; its harmonics are markers at exactly known frequencies. The firmware sweeps the DAC until the IF counter (TIM2 counting the 455 kHz IF) sees each marker, and builds a DAC to LO table from them. After every tune, <strong>AFC</strong> counts the IF for 10 ms against 455.000 kHz and trims the DAC code, so the station stays centred as the board warms up.</p>
</details>
<details class="fold" open><summary><h2 id="gallery">Gallery<svg class="chev" viewBox="0 0 24 24" aria-hidden="true"><path d="M8 10l4 4 4-4" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg></h2></summary>
<div class="scroll-x"><table>
<tr><td><img class="zoom" src="https://wiki.adom.inc/adom/amfm-receiver-molecule/render/docs/screens/layout-top.png" alt="Top copper and silkscreen, 2D"></td><td><img class="zoom" src="https://wiki.adom.inc/adom/amfm-receiver-molecule/render/docs/screens/layout-bottom.png" alt="Bottom copper and silkscreen, 2D, mirrored"></td></tr>
<tr><td><em>Top copper (red) and silkscreen: one outlined block per circuit, signal flowing from the antenna (top right) to the MCU (left).</em></td><td><em>Bottom copper (blue), seen from below. In1 is a ground plane and In2 carries +5VA and +3V3.</em></td></tr>
<tr><td><img class="zoom" src="https://wiki.adom.inc/adom/amfm-receiver-molecule/render/docs/screens/rf-frontend.jpg" alt="RF front end"></td><td><img class="zoom" src="https://wiki.adom.inc/adom/amfm-receiver-molecule/render/docs/screens/if-chain.jpg" alt="IF chain"></td></tr>
<tr><td><em><strong>Analog, RF:</strong> the SMA jack, the diplexer that splits AM from FM, and the FM RF amplifier, LO and mixer.</em></td><td><em><strong>Analog, IF:</strong> the 10.24 MHz crystal oscillator, the two 10.7 MHz filters, the second mixer and the 455 kHz AM filter (HCCF2).</em></td></tr>
<tr><td><img class="zoom" src="https://wiki.adom.inc/adom/amfm-receiver-molecule/render/docs/screens/power.jpg" alt="Power section"></td><td><img class="zoom" src="https://wiki.adom.inc/adom/amfm-receiver-molecule/render/docs/screens/digital.jpg" alt="Digital section"></td></tr>
<tr><td><em><strong>Power:</strong> USB-C in, USBLC6 ESD protection, the OR-ing Schottky diodes and the polyfuse; the 3.3 V LDO sits lower in the same column.</em></td><td><em><strong>Digital:</strong> the STM32G0B1 with its 40 MHz crystal and the SWD, UART and BOOT contacts down the left edge.</em></td></tr>
</table></div>
<p>Every marked part carries its part number and pin-1 dot (laser-etch artwork from its own wiki page), here and in the 3D view above; the Layers button in the 3D view switches the silkscreen, solder mask, copper, parts and part numbers.</p>
</details>
<details class="fold" open><summary><h2 id="where-the-current-and-the-heat-go">Where the current and the heat go<svg class="chev" viewBox="0 0 24 24" aria-hidden="true"><path d="M8 10l4 4 4-4" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg></h2></summary>
<p>Solved from the board file with <a href="https://wiki.adom.inc/adom/adom-fields" target="_blank" rel="noopener">Adom Fields</a> at the radio's estimated operating point (about 85 mA from USB, FM band on; the spec is in <code>docs/fields/spec.json</code>). A small-signal board like this runs cool: the peak current density is 8.6 A/mm² (the screening limit is 60) and the warmest part, the OR-ing diode D105, rises 4.3 °C in still air.</p>
<div class="scroll-x"><table>
<tr><td><img class="zoom" src="https://wiki.adom.inc/adom/amfm-receiver-molecule/render/docs/screens/fields-current.jpg" alt="Current density at the USB power entry"></td><td><img class="zoom" src="https://wiki.adom.inc/adom/amfm-receiver-molecule/render/docs/screens/fields-heat.jpg" alt="Heat flow in the top copper"></td></tr>
<tr><td><em><strong>Current density</strong>, top copper, at the USB-C power entry: VBUS through the OR-ing diodes and the fuse to the +5 V rail.</em></td><td><em><strong>Heat flow</strong> in the top copper: the LDO U102, the MCU U103 and diode D105 are the only sources, each a few degrees above ambient.</em></td></tr>
</table></div>
<p>Adom Fields is a DC solve (current and heat). It does not model RF or EMC behaviour, so the RF performance of the front ends is still hand-calculated (see Status). The STM32's exposed pad has nine 0.3 mm thermal vias as drilled pads in its footprint; Fields 0.6.2 counts board vias only, so they are not in its via tally.</p>
</details>
<details class="fold" open><summary><h2 id="status">Status<svg class="chev" viewBox="0 0 24 24" aria-hidden="true"><path d="M8 10l4 4 4-4" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg></h2></summary>
<p>Designed and checked in KiCad 10 (ERC and DRC clean, netlist checked pin for pin against the generator), with JLCPCB fab files ready. <strong>Not built or tested yet.</strong> RF performance is hand-calculated; expect to trim tank capacitors at bring-up. The firmware is outlined below but not written yet.</p>
</details>
<details class="fold" open><summary><h2 id="parts">Parts<svg class="chev" viewBox="0 0 24 24" aria-hidden="true"><path d="M8 10l4 4 4-4" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg></h2></summary>
<p>All 88 BOM lines (312 parts JLC places, plus the 32 machine pins and contacts the Adom Electronics Prototyping Cloud Lab presses in) link to a wiki page with the symbol, footprint, 3D model, datasheet and the LCSC, Mouser and DigiKey numbers. Pages created for this board carry a verification log; check a page before reusing its part.</p>
<div class="scroll-x"><table class="parts">
<thead>
<tr>
<th>Part</th>
<th align="right">Qty</th>
<th>References</th>
<th>Value</th>
<th>Wiki page</th>
<th>LCSC</th>
</tr>
</thead>
<tbody><tr>
<td><a href="https://wiki.adom.inc/adom/samsung-cl21a-x5r-0805" target="_blank" rel="noopener"><img src="https://wiki.adom.inc/adom/amfm-receiver-molecule/render/docs/parts/cl21a106kaynnne.png?v=e37587efa5" width="64" alt="CL21A106KAYNNNE"></a><br><strong>CL21A106KAYNNNE</strong><br>Samsung Electro-Mechanics</td>
<td align="right">12</td>
<td>C101 C104 C212 C214 C402 C406 C503 C512 C603 C605 C701 C722</td>
<td>10u</td>
<td><a href="https://wiki.adom.inc/adom/samsung-cl21a-x5r-0805" target="_blank" rel="noopener">adom/samsung-cl21a-x5r-0805</a></td>
<td><a href="https://www.lcsc.com/product-detail/C15850.html" target="_blank" rel="noopener">C15850</a></td>
</tr>
<tr>
<td><a href="https://wiki.adom.inc/adom/cc0603-100nf" target="_blank" rel="noopener"><img src="https://wiki.adom.inc/adom/amfm-receiver-molecule/render/docs/parts/cc0603krx7r9bb104.png?v=8d42df3aa9" width="64" alt="CC0603KRX7R9BB104"></a><br><strong>CC0603KRX7R9BB104</strong><br>YAGEO</td>
<td align="right">35</td>
<td>C102 C105 C107 C110 C111 C115 C205 C209 C211 C213 C215 C311 C314 C401 C403 C404 C405 C407 C413 C504 C506 C510 C513 C604 C606 C607 C610 C615 C620 C702 C706 C709 C712 C721 C723</td>
<td>100n</td>
<td><a href="https://wiki.adom.inc/adom/cc0603-100nf" target="_blank" rel="noopener">adom/cc0603-100nf</a></td>
<td><a href="https://www.lcsc.com/product-detail/C14663.html" target="_blank" rel="noopener">C14663</a></td>
</tr>
<tr>
<td><a href="https://wiki.adom.inc/adom/cl10a105kb8nnnc" target="_blank" rel="noopener"><img src="https://wiki.adom.inc/adom/amfm-receiver-molecule/render/docs/parts/cl10a105kb8nnnc.png?v=8d42df3aa9" width="64" alt="CL10A105KB8NNNC"></a><br><strong>CL10A105KB8NNNC</strong><br>Samsung Electro-Mechanics</td>
<td align="right">13</td>
<td>C103 C108 C202 C204 C206 C207 C208 C210 C613 C614 C616 C716 C717</td>
<td>1u</td>
<td><a href="https://wiki.adom.inc/adom/cl10a105kb8nnnc" target="_blank" rel="noopener">adom/cl10a105kb8nnnc</a></td>
<td><a href="https://www.lcsc.com/product-detail/C15849.html" target="_blank" rel="noopener">C15849</a></td>
</tr>
<tr>
<td><a href="https://wiki.adom.inc/adom/samsung-cl21a-x5r-0805" target="_blank" rel="noopener"><img src="https://wiki.adom.inc/adom/amfm-receiver-molecule/render/docs/parts/cl21a226maqnnne.png?v=e37587efa5" width="64" alt="CL21A226MAQNNNE"></a><br><strong>CL21A226MAQNNNE</strong><br>Samsung Electro-Mechanics</td>
<td align="right">1</td>
<td>C106</td>
<td>22u</td>
<td><a href="https://wiki.adom.inc/adom/samsung-cl21a-x5r-0805" target="_blank" rel="noopener">adom/samsung-cl21a-x5r-0805</a></td>
<td><a href="https://www.lcsc.com/product-detail/C45783.html" target="_blank" rel="noopener">C45783</a></td>
</tr>
<tr>
<td><a href="https://wiki.adom.inc/adom/fenghua-0603-mlcc" target="_blank" rel="noopener"><img src="https://wiki.adom.inc/adom/amfm-receiver-molecule/render/docs/parts/0603b103k500nt.png?v=8d42df3aa9" width="64" alt="0603B103K500NT"></a><br><strong>0603B103K500NT</strong><br>FH (Guangdong Fenghua Advanced Tech)</td>
<td align="right">14</td>
<td>C109 C322 C501 C505 C507 C508 C601 C602 C608 C609 C611 C705 C708 C711</td>
<td>10n</td>
<td><a href="https://wiki.adom.inc/adom/fenghua-0603-mlcc" target="_blank" rel="noopener">adom/fenghua-0603-mlcc</a></td>
<td><a href="https://www.lcsc.com/product-detail/C57112.html" target="_blank" rel="noopener">C57112</a></td>
</tr>
<tr>
<td><a href="https://wiki.adom.inc/adom/cl21a475kaqnnng" target="_blank" rel="noopener"><img src="https://wiki.adom.inc/adom/amfm-receiver-molecule/render/docs/parts/cl21a475kaqnnne.png?v=e37587efa5" width="64" alt="CL21A475KAQNNNE"></a><br><strong>CL21A475KAQNNNE</strong><br>Samsung Electro-Mechanics</td>
<td align="right">3</td>
<td>C114 C201 C203</td>
<td>4.7u</td>
<td><a href="https://wiki.adom.inc/adom/cl21a475kaqnnng" target="_blank" rel="noopener">adom/cl21a475kaqnnng</a> (1)</td>
<td><a href="https://www.lcsc.com/product-detail/C1779.html" target="_blank" rel="noopener">C1779</a></td>
</tr>
<tr>
<td><a href="https://wiki.adom.inc/adom/cl10c180jb8nnnc" target="_blank" rel="noopener"><img src="https://wiki.adom.inc/adom/amfm-receiver-molecule/render/docs/parts/cl10c180jb8nnnc.png?v=8d42df3aa9" width="64" alt="CL10C180JB8NNNC"></a><br><strong>CL10C180JB8NNNC</strong><br>Samsung Electro-Mechanics</td>
<td align="right">2</td>
<td>C116 C117</td>
<td>18p</td>
<td><a href="https://wiki.adom.inc/adom/cl10c180jb8nnnc" target="_blank" rel="noopener">adom/cl10c180jb8nnnc</a></td>
<td><a href="https://www.lcsc.com/product-detail/C1647.html" target="_blank" rel="noopener">C1647</a></td>
</tr>
<tr>
<td><a href="https://wiki.adom.inc/adom/murata-grm18-gcm18-c0g-0603" target="_blank" rel="noopener"><img src="https://wiki.adom.inc/adom/amfm-receiver-molecule/render/docs/parts/grm1885c1h272ja01d.png?v=8d42df3aa9" width="64" alt="GRM1885C1H272JA01D"></a><br><strong>GRM1885C1H272JA01D</strong><br>Murata Electronics</td>
<td align="right">2</td>
<td>C301 C302</td>
<td>2.7n</td>
<td><a href="https://wiki.adom.inc/adom/murata-grm18-gcm18-c0g-0603" target="_blank" rel="noopener">adom/murata-grm18-gcm18-c0g-0603</a></td>
<td><a href="https://www.lcsc.com/product-detail/C77034.html" target="_blank" rel="noopener">C77034</a></td>
</tr>
<tr>
<td><a href="https://wiki.adom.inc/adom/samsung-cl10c-c0g-0603" target="_blank" rel="noopener"><img src="https://wiki.adom.inc/adom/amfm-receiver-molecule/render/docs/parts/cl10c470jb8nnnc.png?v=8d42df3aa9" width="64" alt="CL10C470JB8NNNC"></a><br><strong>CL10C470JB8NNNC</strong><br>Samsung Electro-Mechanics</td>
<td align="right">5</td>
<td>C303 C304 C412 C707 C710</td>
<td>47p</td>
<td><a href="https://wiki.adom.inc/adom/samsung-cl10c-c0g-0603" target="_blank" rel="noopener">adom/samsung-cl10c-c0g-0603</a></td>
<td><a href="https://www.lcsc.com/product-detail/C1671.html" target="_blank" rel="noopener">C1671</a></td>
</tr>
<tr>
<td><a href="https://wiki.adom.inc/adom/samsung-cl10c-c0g-0603" target="_blank" rel="noopener"><img src="https://wiki.adom.inc/adom/amfm-receiver-molecule/render/docs/parts/cl10c220jb8nnnc.png?v=8d42df3aa9" width="64" alt="CL10C220JB8NNNC"></a><br><strong>CL10C220JB8NNNC</strong><br>Samsung Electro-Mechanics</td>
<td align="right">7</td>
<td>C305 C306 C310 C320 C502 C509 C714</td>
<td>22p</td>
<td><a href="https://wiki.adom.inc/adom/samsung-cl10c-c0g-0603" target="_blank" rel="noopener">adom/samsung-cl10c-c0g-0603</a></td>
<td><a href="https://www.lcsc.com/product-detail/C1653.html" target="_blank" rel="noopener">C1653</a></td>
</tr>
<tr>
<td><a href="https://wiki.adom.inc/adom/cl10b102kb8nnnc" target="_blank" rel="noopener"><img src="https://wiki.adom.inc/adom/amfm-receiver-molecule/render/docs/parts/cl10b102kb8nnnc.png?v=8d42df3aa9" width="64" alt="CL10B102KB8NNNC"></a><br><strong>CL10B102KB8NNNC</strong><br>Samsung Electro-Mechanics</td>
<td align="right">8</td>
<td>C307 C308 C312 C315 C316 C619 C703 C720</td>
<td>1n</td>
<td><a href="https://wiki.adom.inc/adom/cl10b102kb8nnnc" target="_blank" rel="noopener">adom/cl10b102kb8nnnc</a></td>
<td><a href="https://www.lcsc.com/product-detail/C1588.html" target="_blank" rel="noopener">C1588</a></td>
</tr>
<tr>
<td><a href="https://wiki.adom.inc/adom/yageo-cc0603-npo" target="_blank" rel="noopener"><img src="https://wiki.adom.inc/adom/amfm-receiver-molecule/render/docs/parts/cc0603crnpo9bn3r3.png?v=8d42df3aa9" width="64" alt="CC0603CRNPO9BN3R3"></a><br><strong>CC0603CRNPO9BN3R3</strong><br>YAGEO</td>
<td align="right">2</td>
<td>C309 C319</td>
<td>3.3p</td>
<td><a href="https://wiki.adom.inc/adom/yageo-cc0603-npo" target="_blank" rel="noopener">adom/yageo-cc0603-npo</a></td>
<td><a href="https://www.lcsc.com/product-detail/C282249.html" target="_blank" rel="noopener">C282249</a></td>
</tr>
<tr>
<td><a href="https://wiki.adom.inc/adom/fenghua-0603-mlcc" target="_blank" rel="noopener"><img src="https://wiki.adom.inc/adom/amfm-receiver-molecule/render/docs/parts/0603cg4r7c500nt.png?v=8d42df3aa9" width="64" alt="0603CG4R7C500NT"></a><br><strong>0603CG4R7C500NT</strong><br>FH (Guangdong Fenghua Advanced Tech)</td>
<td align="right">2</td>
<td>C313 C318</td>
<td>4.7p</td>
<td><a href="https://wiki.adom.inc/adom/fenghua-0603-mlcc" target="_blank" rel="noopener">adom/fenghua-0603-mlcc</a></td>
<td><a href="https://www.lcsc.com/product-detail/C1669.html" target="_blank" rel="noopener">C1669</a></td>
</tr>
<tr>
<td><a href="https://wiki.adom.inc/adom/samsung-cl10c-c0g-0603" target="_blank" rel="noopener"><img src="https://wiki.adom.inc/adom/amfm-receiver-molecule/render/docs/parts/cl10c150jb8nnnc.png?v=8d42df3aa9" width="64" alt="CL10C150JB8NNNC"></a><br><strong>CL10C150JB8NNNC</strong><br>Samsung Electro-Mechanics</td>
<td align="right">3</td>
<td>C317 C410 C516</td>
<td>15p</td>
<td><a href="https://wiki.adom.inc/adom/samsung-cl10c-c0g-0603" target="_blank" rel="noopener">adom/samsung-cl10c-c0g-0603</a></td>
<td><a href="https://www.lcsc.com/product-detail/C1644.html" target="_blank" rel="noopener">C1644</a></td>
</tr>
<tr>
<td><a href="https://wiki.adom.inc/adom/fenghua-0603-mlcc" target="_blank" rel="noopener"><img src="https://wiki.adom.inc/adom/amfm-receiver-molecule/render/docs/parts/0603cg2r2c500nt.png?v=8d42df3aa9" width="64" alt="0603CG2R2C500NT"></a><br><strong>0603CG2R2C500NT</strong><br>FH (Guangdong Fenghua Advanced Tech)</td>
<td align="right">1</td>
<td>C321</td>
<td>2.2p</td>
<td><a href="https://wiki.adom.inc/adom/fenghua-0603-mlcc" target="_blank" rel="noopener">adom/fenghua-0603-mlcc</a></td>
<td><a href="https://www.lcsc.com/product-detail/C1651.html" target="_blank" rel="noopener">C1651</a></td>
</tr>
<tr>
<td><a href="https://wiki.adom.inc/adom/samsung-cl10c-c0g-0603" target="_blank" rel="noopener"><img src="https://wiki.adom.inc/adom/amfm-receiver-molecule/render/docs/parts/cl10c101jb8nnnc.png?v=8d42df3aa9" width="64" alt="CL10C101JB8NNNC"></a><br><strong>CL10C101JB8NNNC</strong><br>Samsung Electro-Mechanics</td>
<td align="right">4</td>
<td>C323 C511 C514 C713</td>
<td>100p</td>
<td><a href="https://wiki.adom.inc/adom/samsung-cl10c-c0g-0603" target="_blank" rel="noopener">adom/samsung-cl10c-c0g-0603</a></td>
<td><a href="https://www.lcsc.com/product-detail/C14858.html" target="_blank" rel="noopener">C14858</a></td>
</tr>
<tr>
<td><a href="https://wiki.adom.inc/adom/murata-grm18-gcm18-c0g-0603" target="_blank" rel="noopener"><img src="https://wiki.adom.inc/adom/amfm-receiver-molecule/render/docs/parts/gcm1885c2a221ja16d.png?v=8d42df3aa9" width="64" alt="GCM1885C2A221JA16D"></a><br><strong>GCM1885C2A221JA16D</strong><br>Murata Electronics</td>
<td align="right">2</td>
<td>C408 C515</td>
<td>220p</td>
<td><a href="https://wiki.adom.inc/adom/murata-grm18-gcm18-c0g-0603" target="_blank" rel="noopener">adom/murata-grm18-gcm18-c0g-0603</a></td>
<td><a href="https://www.lcsc.com/product-detail/C388907.html" target="_blank" rel="noopener">C388907</a></td>
</tr>
<tr>
<td><a href="https://wiki.adom.inc/adom/yageo-cc0603-npo" target="_blank" rel="noopener"><img src="https://wiki.adom.inc/adom/amfm-receiver-molecule/render/docs/parts/cc0603jrnpo9bn471.png?v=8d42df3aa9" width="64" alt="CC0603JRNPO9BN471"></a><br><strong>CC0603JRNPO9BN471</strong><br>YAGEO</td>
<td align="right">1</td>
<td>C409</td>
<td>470p</td>
<td><a href="https://wiki.adom.inc/adom/yageo-cc0603-npo" target="_blank" rel="noopener">adom/yageo-cc0603-npo</a></td>
<td><a href="https://www.lcsc.com/product-detail/C106211.html" target="_blank" rel="noopener">C106211</a></td>
</tr>
<tr>
<td><a href="https://wiki.adom.inc/adom/samsung-cl10c-c0g-0603" target="_blank" rel="noopener"><img src="https://wiki.adom.inc/adom/amfm-receiver-molecule/render/docs/parts/cl10c330jb8nnnc.png?v=8d42df3aa9" width="64" alt="CL10C330JB8NNNC"></a><br><strong>CL10C330JB8NNNC</strong><br>Samsung Electro-Mechanics</td>
<td align="right">1</td>
<td>C411</td>
<td>33p</td>
<td><a href="https://wiki.adom.inc/adom/samsung-cl10c-c0g-0603" target="_blank" rel="noopener">adom/samsung-cl10c-c0g-0603</a></td>
<td><a href="https://www.lcsc.com/product-detail/C1663.html" target="_blank" rel="noopener">C1663</a></td>
</tr>
<tr>
<td><a href="https://wiki.adom.inc/adom/0603n222j500ct" target="_blank" rel="noopener"><img src="https://wiki.adom.inc/adom/amfm-receiver-molecule/render/docs/parts/0603n222j500ct.png?v=8d42df3aa9" width="64" alt="0603N222J500CT"></a><br><strong>0603N222J500CT</strong><br>Walsin Tech Corp</td>
<td align="right">2</td>
<td>C612 C618</td>
<td>2.2n</td>
<td><a href="https://wiki.adom.inc/adom/0603n222j500ct" target="_blank" rel="noopener">adom/0603n222j500ct</a></td>
<td><a href="https://www.lcsc.com/product-detail/C296055.html" target="_blank" rel="noopener">C296055</a></td>
</tr>
<tr>
<td><a href="https://wiki.adom.inc/adom/yageo-cc0603-npo" target="_blank" rel="noopener"><img src="https://wiki.adom.inc/adom/amfm-receiver-molecule/render/docs/parts/cc0603jrnpo9bn472.png?v=8d42df3aa9" width="64" alt="CC0603JRNPO9BN472"></a><br><strong>CC0603JRNPO9BN472</strong><br>YAGEO</td>
<td align="right">1</td>
<td>C617</td>
<td>4.7n</td>
<td><a href="https://wiki.adom.inc/adom/yageo-cc0603-npo" target="_blank" rel="noopener">adom/yageo-cc0603-npo</a></td>
<td><a href="https://www.lcsc.com/product-detail/C576818.html" target="_blank" rel="noopener">C576818</a></td>
</tr>
<tr>
<td><a href="https://wiki.adom.inc/adom/yageo-cc0603-npo" target="_blank" rel="noopener"><img src="https://wiki.adom.inc/adom/amfm-receiver-molecule/render/docs/parts/cc0603jrnpo9bn151.png?v=8d42df3aa9" width="64" alt="CC0603JRNPO9BN151"></a><br><strong>CC0603JRNPO9BN151</strong><br>YAGEO</td>
<td align="right">1</td>
<td>C704</td>
<td>150p</td>
<td><a href="https://wiki.adom.inc/adom/yageo-cc0603-npo" target="_blank" rel="noopener">adom/yageo-cc0603-npo</a></td>
<td><a href="https://www.lcsc.com/product-detail/C107038.html" target="_blank" rel="noopener">C107038</a></td>
</tr>
<tr>
<td><a href="https://wiki.adom.inc/adom/yageo-cc0603-npo" target="_blank" rel="noopener"><img src="https://wiki.adom.inc/adom/amfm-receiver-molecule/render/docs/parts/cc0603jrnpo9bn152.png?v=8d42df3aa9" width="64" alt="CC0603JRNPO9BN152"></a><br><strong>CC0603JRNPO9BN152</strong><br>YAGEO</td>
<td align="right">2</td>
<td>C715 C718</td>
<td>1.5n</td>
<td><a href="https://wiki.adom.inc/adom/yageo-cc0603-npo" target="_blank" rel="noopener">adom/yageo-cc0603-npo</a></td>
<td><a href="https://www.lcsc.com/product-detail/C107039.html" target="_blank" rel="noopener">C107039</a></td>
</tr>
<tr>
<td><a href="https://wiki.adom.inc/adom/yageo-cc0603-npo" target="_blank" rel="noopener"><img src="https://wiki.adom.inc/adom/amfm-receiver-molecule/render/docs/parts/cc0603jrnpo9bn681.png?v=8d42df3aa9" width="64" alt="CC0603JRNPO9BN681"></a><br><strong>CC0603JRNPO9BN681</strong><br>YAGEO</td>
<td align="right">1</td>
<td>C719</td>
<td>680p</td>
<td><a href="https://wiki.adom.inc/adom/yageo-cc0603-npo" target="_blank" rel="noopener">adom/yageo-cc0603-npo</a></td>
<td><a href="https://www.lcsc.com/product-detail/C107055.html" target="_blank" rel="noopener">C107055</a></td>
</tr>
<tr>
<td><a href="https://wiki.adom.inc/barrett-land/kt-0603r" target="_blank" rel="noopener"><img src="https://wiki.adom.inc/adom/amfm-receiver-molecule/render/docs/parts/kt-0603r.png?v=eab4516ca5" width="64" alt="KT-0603R"></a><br><strong>KT-0603R</strong><br>Hubei KENTO Elec</td>
<td align="right">1</td>
<td>D104</td>
<td>RED</td>
<td><a href="https://wiki.adom.inc/barrett-land/kt-0603r" target="_blank" rel="noopener">barrett-land/kt-0603r</a></td>
<td><a href="https://www.lcsc.com/product-detail/C2286.html" target="_blank" rel="noopener">C2286</a></td>
</tr>
<tr>
<td><a href="https://wiki.adom.inc/adom/b5819w" target="_blank" rel="noopener"><img src="https://wiki.adom.inc/adom/amfm-receiver-molecule/render/docs/parts/b5819w_sl.png?v=4c99aca2d5" width="64" alt="B5819W SL"></a><br><strong>B5819W SL</strong><br>Jiangsu Changjing Electronics Technology Co., Ltd.</td>
<td align="right">2</td>
<td>D105 D106</td>
<td>B5819W</td>
<td><a href="https://wiki.adom.inc/adom/b5819w" target="_blank" rel="noopener">adom/b5819w</a></td>
<td><a href="https://www.lcsc.com/product-detail/C8598.html" target="_blank" rel="noopener">C8598</a></td>
</tr>
<tr>
<td><a href="https://wiki.adom.inc/adom/kt-0603g" target="_blank" rel="noopener"><img src="https://wiki.adom.inc/adom/amfm-receiver-molecule/render/docs/parts/kt-0603g.png?v=3a8f669d00" width="64" alt="KT-0603G"></a><br><strong>KT-0603G</strong><br>Hubei KENTO Elec</td>
<td align="right">1</td>
<td>D201</td>
<td>GREEN (FM)</td>
<td><a href="https://wiki.adom.inc/adom/kt-0603g" target="_blank" rel="noopener">adom/kt-0603g</a></td>
<td><a href="https://www.lcsc.com/product-detail/C12624.html" target="_blank" rel="noopener">C12624</a></td>
</tr>
<tr>
<td><a href="https://wiki.adom.inc/adom/kt-0603y" target="_blank" rel="noopener"><img src="https://wiki.adom.inc/adom/amfm-receiver-molecule/render/docs/parts/kt-0603y.png?v=dd898e0f2c" width="64" alt="KT-0603Y"></a><br><strong>KT-0603Y</strong><br>Hubei KENTO Elec</td>
<td align="right">1</td>
<td>D202</td>
<td>YELLOW (AM)</td>
<td><a href="https://wiki.adom.inc/adom/kt-0603y" target="_blank" rel="noopener">adom/kt-0603y</a></td>
<td><a href="https://www.lcsc.com/product-detail/C2287.html" target="_blank" rel="noopener">C2287</a></td>
</tr>
<tr>
<td><a href="https://wiki.adom.inc/barrett-land/kt-0603b" target="_blank" rel="noopener"><img src="https://wiki.adom.inc/adom/amfm-receiver-molecule/render/docs/parts/kt-0603b.png?v=67eb76295c" width="64" alt="KT-0603B"></a><br><strong>KT-0603B</strong><br>Hubei KENTO Elec</td>
<td align="right">1</td>
<td>D203</td>
<td>BLUE (USB/stereo)</td>
<td><a href="https://wiki.adom.inc/barrett-land/kt-0603b" target="_blank" rel="noopener">barrett-land/kt-0603b</a></td>
<td><a href="https://www.lcsc.com/product-detail/C2288.html" target="_blank" rel="noopener">C2288</a></td>
</tr>
<tr>
<td><a href="https://wiki.adom.inc/adom/bb910" target="_blank" rel="noopener"><img src="https://wiki.adom.inc/adom/amfm-receiver-molecule/render/docs/parts/bb910.png?v=1168feb048" width="64" alt="BB910"></a><br><strong>BB910</strong><br>Shikues</td>
<td align="right">3</td>
<td>D301 D302 D401</td>
<td>BB910</td>
<td><a href="https://wiki.adom.inc/adom/bb910" target="_blank" rel="noopener">adom/bb910</a></td>
<td><a href="https://www.lcsc.com/product-detail/C475628.html" target="_blank" rel="noopener">C475628</a></td>
</tr>
<tr>
<td><a href="https://wiki.adom.inc/adom/bat54ws-7-f" target="_blank" rel="noopener"><img src="https://wiki.adom.inc/adom/amfm-receiver-molecule/render/docs/parts/bat54ws-7-f.png?v=9fbe190b7f" width="64" alt="BAT54WS-7-F"></a><br><strong>BAT54WS-7-F</strong><br>Diodes Incorporated</td>
<td align="right">2</td>
<td>D601 D701</td>
<td>BAT54WS</td>
<td><a href="https://wiki.adom.inc/adom/bat54ws-7-f" target="_blank" rel="noopener">adom/bat54ws-7-f</a></td>
<td><a href="https://www.lcsc.com/product-detail/C124205.html" target="_blank" rel="noopener">C124205</a></td>
</tr>
<tr>
<td><a href="https://wiki.adom.inc/adom/bat54s" target="_blank" rel="noopener"><img src="https://wiki.adom.inc/adom/amfm-receiver-molecule/render/docs/parts/bat54s.png?v=6f80266cd9" width="64" alt="BAT54S"></a><br><strong>BAT54S</strong><br>MDD(Microdiode Semiconductor)</td>
<td align="right">1</td>
<td>D702</td>
<td>BAT54S</td>
<td><a href="https://wiki.adom.inc/adom/bat54s" target="_blank" rel="noopener">adom/bat54s</a> (2)</td>
<td><a href="https://www.lcsc.com/product-detail/C408389.html" target="_blank" rel="noopener">C408389</a></td>
</tr>
<tr>
<td><a href="https://wiki.adom.inc/adom/nsmd050-33v" target="_blank" rel="noopener"><img src="https://wiki.adom.inc/adom/amfm-receiver-molecule/render/docs/parts/nsmd050-33v.png?v=ebf67dc481" width="64" alt="nSMD050-33V"></a><br><strong>nSMD050-33V</strong><br>TECHFUSE</td>
<td align="right">1</td>
<td>F101</td>
<td>500mA</td>
<td><a href="https://wiki.adom.inc/adom/nsmd050-33v" target="_blank" rel="noopener">adom/nsmd050-33v</a></td>
<td><a href="https://www.lcsc.com/product-detail/C70077.html" target="_blank" rel="noopener">C70077</a></td>
</tr>
<tr>
<td><a href="https://wiki.adom.inc/adom/gz1608d601tf" target="_blank" rel="noopener"><img src="https://wiki.adom.inc/adom/amfm-receiver-molecule/render/docs/parts/gz1608d601tf.png?v=3c1ead43c6" width="64" alt="GZ1608D601TF"></a><br><strong>GZ1608D601TF</strong><br>Sunlord</td>
<td align="right">2</td>
<td>FB101 FB102</td>
<td>600R@100MHz</td>
<td><a href="https://wiki.adom.inc/adom/gz1608d601tf" target="_blank" rel="noopener">adom/gz1608d601tf</a></td>
<td><a href="https://www.lcsc.com/product-detail/C1002.html" target="_blank" rel="noopener">C1002</a></td>
</tr>
<tr>
<td><a href="https://wiki.adom.inc/adom/hccf3-10-700-ltcvs3l" target="_blank" rel="noopener"><img src="https://wiki.adom.inc/adom/amfm-receiver-molecule/render/docs/parts/hccf3-10.700-ltcvs3l.png?v=48d45f603e" width="64" alt="HCCF3-10.700-LTCVS3L"></a><br><strong>HCCF3-10.700-LTCVS3L</strong><br>HCI</td>
<td align="right">2</td>
<td>FL501 FL502</td>
<td>HCCF3-10.700-LTCVS3L</td>
<td><a href="https://wiki.adom.inc/adom/hccf3-10-700-ltcvs3l" target="_blank" rel="noopener">adom/hccf3-10-700-ltcvs3l</a></td>
<td><a href="https://www.lcsc.com/product-detail/C19191232.html" target="_blank" rel="noopener">C19191232</a></td>
</tr>
<tr>
<td><a href="https://wiki.adom.inc/adom/hccf2-455-000-ltwcgl" target="_blank" rel="noopener"><img src="https://wiki.adom.inc/adom/amfm-receiver-molecule/render/docs/parts/hccf2-455.000-ltwcgl.png?v=119a229e40" width="64" alt="HCCF2-455.000-LTWCGL"></a><br><strong>HCCF2-455.000-LTWCGL</strong><br>HCI</td>
<td align="right">1</td>
<td>FL601</td>
<td>HCCF2-455.000-LTWCGL</td>
<td><a href="https://wiki.adom.inc/adom/hccf2-455-000-ltwcgl" target="_blank" rel="noopener">adom/hccf2-455-000-ltwcgl</a></td>
<td><a href="https://www.lcsc.com/product-detail/C19186014.html" target="_blank" rel="noopener">C19186014</a></td>
</tr>
<tr>
<td><a href="https://wiki.adom.inc/adom/type-c-31-m-12" target="_blank" rel="noopener"><img src="https://wiki.adom.inc/adom/amfm-receiver-molecule/render/docs/parts/type-c-31-m-12.png?v=7d35df6c11" width="64" alt="TYPE-C-31-M-12"></a><br><strong>TYPE-C-31-M-12</strong><br>Korean Hroparts Elec</td>
<td align="right">1</td>
<td>J101</td>
<td>USB-C</td>
<td><a href="https://wiki.adom.inc/adom/type-c-31-m-12" target="_blank" rel="noopener">adom/type-c-31-m-12</a></td>
<td><a href="https://www.lcsc.com/product-detail/C165948.html" target="_blank" rel="noopener">C165948</a></td>
</tr>
<tr>
<td><a href="https://wiki.adom.inc/adom/bwsma-kwe-z001" target="_blank" rel="noopener"><img src="https://wiki.adom.inc/adom/amfm-receiver-molecule/render/docs/parts/bwsma-kwe-z001.png?v=9bbdc2a42f" width="64" alt="BWSMA-KWE-Z001"></a><br><strong>BWSMA-KWE-Z001</strong><br>BAT WIRELESS</td>
<td align="right">1</td>
<td>J301</td>
<td>ANT (SMA)</td>
<td><a href="https://wiki.adom.inc/adom/bwsma-kwe-z001" target="_blank" rel="noopener">adom/bwsma-kwe-z001</a></td>
<td><a href="https://www.lcsc.com/product-detail/C496551.html" target="_blank" rel="noopener">C496551</a></td>
</tr>
<tr>
<td><a href="https://wiki.adom.inc/adom/nlv32t-2r2j-pf" target="_blank" rel="noopener"><img src="https://wiki.adom.inc/adom/amfm-receiver-molecule/render/docs/parts/nlv32t-2r2j-pf.png?v=7ab0da85b8" width="64" alt="NLV32T-2R2J-PF"></a><br><strong>NLV32T-2R2J-PF</strong><br>TDK</td>
<td align="right">2</td>
<td>L301 L303</td>
<td>2.2u</td>
<td><a href="https://wiki.adom.inc/adom/nlv32t-2r2j-pf" target="_blank" rel="noopener">adom/nlv32t-2r2j-pf</a></td>
<td><a href="https://www.lcsc.com/product-detail/C89016.html" target="_blank" rel="noopener">C89016</a></td>
</tr>
<tr>
<td><a href="https://wiki.adom.inc/adom/yscm322522-8r2j" target="_blank" rel="noopener"><img src="https://wiki.adom.inc/adom/amfm-receiver-molecule/render/docs/parts/yscm322522-8r2j.png?v=0001ba5a25" width="64" alt="YSCM322522-8R2J"></a><br><strong>YSCM322522-8R2J</strong><br>YJYCOIN</td>
<td align="right">2</td>
<td>L302 L401</td>
<td>8.2u</td>
<td><a href="https://wiki.adom.inc/adom/yscm322522-8r2j" target="_blank" rel="noopener">adom/yscm322522-8r2j</a></td>
<td><a href="https://www.lcsc.com/product-detail/C52259800.html" target="_blank" rel="noopener">C52259800</a></td>
</tr>
<tr>
<td><a href="https://wiki.adom.inc/adom/murata-lqw18an" target="_blank" rel="noopener"><img src="https://wiki.adom.inc/adom/amfm-receiver-molecule/render/docs/parts/lqw18an56ng00d.png?v=3c1ead43c6" width="64" alt="LQW18AN56NG00D"></a><br><strong>LQW18AN56NG00D</strong><br>Murata Electronics</td>
<td align="right">1</td>
<td>L304</td>
<td>56n</td>
<td><a href="https://wiki.adom.inc/adom/murata-lqw18an" target="_blank" rel="noopener">adom/murata-lqw18an</a></td>
<td><a href="https://www.lcsc.com/product-detail/C98079.html" target="_blank" rel="noopener">C98079</a></td>
</tr>
<tr>
<td><a href="https://wiki.adom.inc/adom/murata-lqw18an" target="_blank" rel="noopener"><img src="https://wiki.adom.inc/adom/amfm-receiver-molecule/render/docs/parts/lqw18anr12g00d.png?v=3c1ead43c6" width="64" alt="LQW18ANR12G00D"></a><br><strong>LQW18ANR12G00D</strong><br>Murata Electronics</td>
<td align="right">1</td>
<td>L305</td>
<td>120n</td>
<td><a href="https://wiki.adom.inc/adom/murata-lqw18an" target="_blank" rel="noopener">adom/murata-lqw18an</a></td>
<td><a href="https://www.lcsc.com/product-detail/C86138.html" target="_blank" rel="noopener">C86138</a></td>
</tr>
<tr>
<td><a href="https://wiki.adom.inc/adom/murata-lqw18an" target="_blank" rel="noopener"><img src="https://wiki.adom.inc/adom/amfm-receiver-molecule/render/docs/parts/lqw18anr15g00d.png?v=3c1ead43c6" width="64" alt="LQW18ANR15G00D"></a><br><strong>LQW18ANR15G00D</strong><br>Murata Electronics</td>
<td align="right">1</td>
<td>L306</td>
<td>150n</td>
<td><a href="https://wiki.adom.inc/adom/murata-lqw18an" target="_blank" rel="noopener">adom/murata-lqw18an</a></td>
<td><a href="https://www.lcsc.com/product-detail/C113131.html" target="_blank" rel="noopener">C113131</a></td>
</tr>
<tr>
<td><a href="https://wiki.adom.inc/adom/murata-lqw18an" target="_blank" rel="noopener"><img src="https://wiki.adom.inc/adom/amfm-receiver-molecule/render/docs/parts/lqw18anr11g00d.png?v=3c1ead43c6" width="64" alt="LQW18ANR11G00D"></a><br><strong>LQW18ANR11G00D</strong><br>Murata Electronics</td>
<td align="right">1</td>
<td>L307</td>
<td>110n</td>
<td><a href="https://wiki.adom.inc/adom/murata-lqw18an" target="_blank" rel="noopener">adom/murata-lqw18an</a></td>
<td><a href="https://www.lcsc.com/product-detail/C113130.html" target="_blank" rel="noopener">C113130</a></td>
</tr>
<tr>
<td><a href="https://wiki.adom.inc/adom/mmbt3906" target="_blank" rel="noopener"><img src="https://wiki.adom.inc/adom/amfm-receiver-molecule/render/docs/parts/mmbt3906_2a.png?v=3d4cda9134" width="64" alt="MMBT3906 2A(RANGE:100-300)"></a><br><strong>MMBT3906 2A(RANGE:100-300)</strong><br>Jiangsu Changjing Electronics Technology Co., Ltd.</td>
<td align="right">2</td>
<td>Q201 Q202</td>
<td>MMBT3906</td>
<td><a href="https://wiki.adom.inc/adom/mmbt3906" target="_blank" rel="noopener">adom/mmbt3906</a> (3)</td>
<td><a href="https://www.lcsc.com/product-detail/C2143.html" target="_blank" rel="noopener">C2143</a></td>
</tr>
<tr>
<td><a href="https://wiki.adom.inc/adom/mmbth10" target="_blank" rel="noopener"><img src="https://wiki.adom.inc/adom/amfm-receiver-molecule/render/docs/parts/mmbth10.png?v=fb68917160" width="64" alt="MMBTH10"></a><br><strong>MMBTH10</strong><br>UMW(Youtai Semiconductor Co., Ltd.)</td>
<td align="right">3</td>
<td>Q301 Q302 Q303</td>
<td>MMBTH10</td>
<td><a href="https://wiki.adom.inc/adom/mmbth10" target="_blank" rel="noopener">adom/mmbth10</a></td>
<td><a href="https://www.lcsc.com/product-detail/C545531.html" target="_blank" rel="noopener">C545531</a></td>
</tr>
<tr>
<td><a href="https://wiki.adom.inc/adom/mmbt3904" target="_blank" rel="noopener"><img src="https://wiki.adom.inc/adom/amfm-receiver-molecule/render/docs/parts/mmbt3904.png?v=fd2f787ceb" width="64" alt="MMBT3904(RANGE:100-300)"></a><br><strong>MMBT3904(RANGE:100-300)</strong><br>Jiangsu Changjing Electronics Technology Co., Ltd.</td>
<td align="right">12</td>
<td>Q401 Q402 Q403 Q501 Q502 Q503 Q602 Q604 Q605 Q701 Q702 Q703</td>
<td>MMBT3904</td>
<td><a href="https://wiki.adom.inc/adom/mmbt3904" target="_blank" rel="noopener">adom/mmbt3904</a> (4)</td>
<td><a href="https://www.lcsc.com/product-detail/C20526.html" target="_blank" rel="noopener">C20526</a></td>
</tr>
<tr>
<td><a href="https://wiki.adom.inc/adom/bc847bs" target="_blank" rel="noopener"><img src="https://wiki.adom.inc/adom/amfm-receiver-molecule/render/docs/parts/bc847bs.png?v=47b054dd66" width="64" alt="BC847BS"></a><br><strong>BC847BS</strong><br>FUXINSEMI</td>
<td align="right">2</td>
<td>Q601 Q603</td>
<td>BC847BS</td>
<td><a href="https://wiki.adom.inc/adom/bc847bs" target="_blank" rel="noopener">adom/bc847bs</a></td>
<td><a href="https://www.lcsc.com/product-detail/C5380687.html" target="_blank" rel="noopener">C5380687</a></td>
</tr>
<tr>
<td><a href="https://wiki.adom.inc/adom/0603waf5101t5e" target="_blank" rel="noopener"><img src="https://wiki.adom.inc/adom/amfm-receiver-molecule/render/docs/parts/0603waf5101t5e.png?v=0b10a8a41a" width="64" alt="0603WAF5101T5E"></a><br><strong>0603WAF5101T5E</strong><br>UNI-ROYAL(Uniroyal Elec)</td>
<td align="right">2</td>
<td>R101 R102</td>
<td>5.1k</td>
<td><a href="https://wiki.adom.inc/adom/0603waf5101t5e" target="_blank" rel="noopener">adom/0603waf5101t5e</a></td>
<td><a href="https://www.lcsc.com/product-detail/C23186.html" target="_blank" rel="noopener">C23186</a></td>
</tr>
<tr>
<td><a href="https://wiki.adom.inc/adom/0603waf1002t5e" target="_blank" rel="noopener"><img src="https://wiki.adom.inc/adom/amfm-receiver-molecule/render/docs/parts/0603waf1002t5e.png?v=0b10a8a41a" width="64" alt="0603WAF1002T5E"></a><br><strong>0603WAF1002T5E</strong><br>UNI-ROYAL(Uniroyal Elec)</td>
<td align="right">33</td>
<td>R103 R201 R203 R204 R205 R207 R208 R209 R210 R211 R214 R215 R217 R219 R310 R604 R605 R608 R609 R610 R614 R619 R622 R624 R625 R627 R628 R704 R708 R713 R717 R722 R723</td>
<td>10k</td>
<td><a href="https://wiki.adom.inc/adom/0603waf1002t5e" target="_blank" rel="noopener">adom/0603waf1002t5e</a></td>
<td><a href="https://www.lcsc.com/product-detail/C25804.html" target="_blank" rel="noopener">C25804</a></td>
</tr>
<tr>
<td><a href="https://wiki.adom.inc/adom/uniroyal-0603waf" target="_blank" rel="noopener"><img src="https://wiki.adom.inc/adom/amfm-receiver-molecule/render/docs/parts/0603waf2201t5e.png?v=0b10a8a41a" width="64" alt="0603WAF2201T5E"></a><br><strong>0603WAF2201T5E</strong><br>UNI-ROYAL(Uniroyal Elec)</td>
<td align="right">7</td>
<td>R107 R606 R611 R617 R702 R706 R710</td>
<td>2.2k</td>
<td><a href="https://wiki.adom.inc/adom/uniroyal-0603waf" target="_blank" rel="noopener">adom/uniroyal-0603waf</a></td>
<td><a href="https://www.lcsc.com/product-detail/C4190.html" target="_blank" rel="noopener">C4190</a></td>
</tr>
<tr>
<td><a href="https://wiki.adom.inc/adom/0603waf2202t5e" target="_blank" rel="noopener"><img src="https://wiki.adom.inc/adom/amfm-receiver-molecule/render/docs/parts/0603waf2202t5e.png?v=0b10a8a41a" width="64" alt="0603WAF2202T5E"></a><br><strong>0603WAF2202T5E</strong><br>UNI-ROYAL(Uniroyal Elec)</td>
<td align="right">9</td>
<td>R202 R206 R212 R314 R403 R409 R410 R413 R510</td>
<td>22k</td>
<td><a href="https://wiki.adom.inc/adom/0603waf2202t5e" target="_blank" rel="noopener">adom/0603waf2202t5e</a></td>
<td><a href="https://www.lcsc.com/product-detail/C31850.html" target="_blank" rel="noopener">C31850</a></td>
</tr>
<tr>
<td><a href="https://wiki.adom.inc/adom/0603waf1001t5e" target="_blank" rel="noopener"><img src="https://wiki.adom.inc/adom/amfm-receiver-molecule/render/docs/parts/0603waf1001t5e.png?v=0b10a8a41a" width="64" alt="0603WAF1001T5E"></a><br><strong>0603WAF1001T5E</strong><br>UNI-ROYAL(Uniroyal Elec)</td>
<td align="right">7</td>
<td>R213 R218 R220 R225 R629 R715 R724</td>
<td>1k</td>
<td><a href="https://wiki.adom.inc/adom/0603waf1001t5e" target="_blank" rel="noopener">adom/0603waf1001t5e</a></td>
<td><a href="https://www.lcsc.com/product-detail/C21190.html" target="_blank" rel="noopener">C21190</a></td>
</tr>
<tr>
<td><a href="https://wiki.adom.inc/adom/0603waf1000t5e" target="_blank" rel="noopener"><img src="https://wiki.adom.inc/adom/amfm-receiver-molecule/render/docs/parts/0603waf1000t5e.png?v=0b10a8a41a" width="64" alt="0603WAF1000T5E"></a><br><strong>0603WAF1000T5E</strong><br>UNI-ROYAL(Uniroyal Elec)</td>
<td align="right">1</td>
<td>R216</td>
<td>100</td>
<td><a href="https://wiki.adom.inc/adom/0603waf1000t5e" target="_blank" rel="noopener">adom/0603waf1000t5e</a></td>
<td><a href="https://www.lcsc.com/product-detail/C22775.html" target="_blank" rel="noopener">C22775</a></td>
</tr>
<tr>
<td><a href="https://wiki.adom.inc/adom/uniroyal-0603waf" target="_blank" rel="noopener"><img src="https://wiki.adom.inc/adom/amfm-receiver-molecule/render/docs/parts/0603waf2200t5e.png?v=0b10a8a41a" width="64" alt="0603WAF2200T5E"></a><br><strong>0603WAF2200T5E</strong><br>UNI-ROYAL(Uniroyal Elec)</td>
<td align="right">3</td>
<td>R224 R226 R512</td>
<td>220</td>
<td><a href="https://wiki.adom.inc/adom/uniroyal-0603waf" target="_blank" rel="noopener">adom/uniroyal-0603waf</a></td>
<td><a href="https://www.lcsc.com/product-detail/C22962.html" target="_blank" rel="noopener">C22962</a></td>
</tr>
<tr>
<td><a href="https://wiki.adom.inc/adom/uniroyal-0603waf" target="_blank" rel="noopener"><img src="https://wiki.adom.inc/adom/amfm-receiver-molecule/render/docs/parts/0603waf1003t5e.png?v=0b10a8a41a" width="64" alt="0603WAF1003T5E"></a><br><strong>0603WAF1003T5E</strong><br>UNI-ROYAL(Uniroyal Elec)</td>
<td align="right">9</td>
<td>R301 R307 R313 R412 R620 R626 R712 R719 R721</td>
<td>100k</td>
<td><a href="https://wiki.adom.inc/adom/uniroyal-0603waf" target="_blank" rel="noopener">adom/uniroyal-0603waf</a></td>
<td><a href="https://www.lcsc.com/product-detail/C25803.html" target="_blank" rel="noopener">C25803</a></td>
</tr>
<tr>
<td><a href="https://wiki.adom.inc/adom/uniroyal-0603waf" target="_blank" rel="noopener"><img src="https://wiki.adom.inc/adom/amfm-receiver-molecule/render/docs/parts/0603waf560jt5e.png?v=0b10a8a41a" width="64" alt="0603WAF560JT5E"></a><br><strong>0603WAF560JT5E</strong><br>UNI-ROYAL(Uniroyal Elec)</td>
<td align="right">2</td>
<td>R302 R406</td>
<td>56</td>
<td><a href="https://wiki.adom.inc/adom/uniroyal-0603waf" target="_blank" rel="noopener">adom/uniroyal-0603waf</a></td>
<td><a href="https://www.lcsc.com/product-detail/C25196.html" target="_blank" rel="noopener">C25196</a></td>
</tr>
<tr>
<td><a href="https://wiki.adom.inc/adom/0603waf4701t5e" target="_blank" rel="noopener"><img src="https://wiki.adom.inc/adom/amfm-receiver-molecule/render/docs/parts/0603waf4701t5e.png?v=0b10a8a41a" width="64" alt="0603WAF4701T5E"></a><br><strong>0603WAF4701T5E</strong><br>UNI-ROYAL(Uniroyal Elec)</td>
<td align="right">5</td>
<td>R303 R311 R623 R714 R716</td>
<td>4.7k</td>
<td><a href="https://wiki.adom.inc/adom/0603waf4701t5e" target="_blank" rel="noopener">adom/0603waf4701t5e</a></td>
<td><a href="https://www.lcsc.com/product-detail/C23162.html" target="_blank" rel="noopener">C23162</a></td>
</tr>
<tr>
<td><a href="https://wiki.adom.inc/adom/uniroyal-0603waf" target="_blank" rel="noopener"><img src="https://wiki.adom.inc/adom/amfm-receiver-molecule/render/docs/parts/0603waf1801t5e.png?v=0b10a8a41a" width="64" alt="0603WAF1801T5E"></a><br><strong>0603WAF1801T5E</strong><br>UNI-ROYAL(Uniroyal Elec)</td>
<td align="right">1</td>
<td>R304</td>
<td>1.8k</td>
<td><a href="https://wiki.adom.inc/adom/uniroyal-0603waf" target="_blank" rel="noopener">adom/uniroyal-0603waf</a></td>
<td><a href="https://www.lcsc.com/product-detail/C4177.html" target="_blank" rel="noopener">C4177</a></td>
</tr>
<tr>
<td><a href="https://wiki.adom.inc/adom/0603waf220jt5e" target="_blank" rel="noopener"><img src="https://wiki.adom.inc/adom/amfm-receiver-molecule/render/docs/parts/0603waf220jt5e.png?v=0b10a8a41a" width="64" alt="0603WAF220JT5E"></a><br><strong>0603WAF220JT5E</strong><br>UNI-ROYAL(Uniroyal Elec)</td>
<td align="right">7</td>
<td>R305 R405 R502 R506 R514 R602 R701</td>
<td>22</td>
<td><a href="https://wiki.adom.inc/adom/0603waf220jt5e" target="_blank" rel="noopener">adom/0603waf220jt5e</a></td>
<td><a href="https://www.lcsc.com/product-detail/C23345.html" target="_blank" rel="noopener">C23345</a></td>
</tr>
<tr>
<td><a href="https://wiki.adom.inc/adom/uniroyal-0603waf" target="_blank" rel="noopener"><img src="https://wiki.adom.inc/adom/amfm-receiver-molecule/render/docs/parts/0603waf820jt5e.png?v=0b10a8a41a" width="64" alt="0603WAF820JT5E"></a><br><strong>0603WAF820JT5E</strong><br>UNI-ROYAL(Uniroyal Elec)</td>
<td align="right">1</td>
<td>R306</td>
<td>82</td>
<td><a href="https://wiki.adom.inc/adom/uniroyal-0603waf" target="_blank" rel="noopener">adom/uniroyal-0603waf</a></td>
<td><a href="https://www.lcsc.com/product-detail/C23255.html" target="_blank" rel="noopener">C23255</a></td>
</tr>
<tr>
<td><a href="https://wiki.adom.inc/adom/0603waf470jt5e" target="_blank" rel="noopener"><img src="https://wiki.adom.inc/adom/amfm-receiver-molecule/render/docs/parts/0603waf470jt5e.png?v=0b10a8a41a" width="64" alt="0603WAF470JT5E"></a><br><strong>0603WAF470JT5E</strong><br>UNI-ROYAL(Uniroyal Elec)</td>
<td align="right">5</td>
<td>R308 R309 R402 R408 R615</td>
<td>47</td>
<td><a href="https://wiki.adom.inc/adom/0603waf470jt5e" target="_blank" rel="noopener">adom/0603waf470jt5e</a></td>
<td><a href="https://www.lcsc.com/product-detail/C23182.html" target="_blank" rel="noopener">C23182</a></td>
</tr>
<tr>
<td><a href="https://wiki.adom.inc/adom/0603waf3300t5e" target="_blank" rel="noopener"><img src="https://wiki.adom.inc/adom/amfm-receiver-molecule/render/docs/parts/0603waf3300t5e.png?v=0b10a8a41a" width="64" alt="0603WAF3300T5E"></a><br><strong>0603WAF3300T5E</strong><br>UNI-ROYAL(Uniroyal Elec)</td>
<td align="right">6</td>
<td>R312 R501 R503 R508 R509 R616</td>
<td>330</td>
<td><a href="https://wiki.adom.inc/adom/0603waf3300t5e" target="_blank" rel="noopener">adom/0603waf3300t5e</a></td>
<td><a href="https://www.lcsc.com/product-detail/C23138.html" target="_blank" rel="noopener">C23138</a></td>
</tr>
<tr>
<td><a href="https://wiki.adom.inc/adom/0603waf6801t5e" target="_blank" rel="noopener"><img src="https://wiki.adom.inc/adom/amfm-receiver-molecule/render/docs/parts/0603waf6801t5e.png?v=0b10a8a41a" width="64" alt="0603WAF6801T5E"></a><br><strong>0603WAF6801T5E</strong><br>UNI-ROYAL(Uniroyal Elec)</td>
<td align="right">5</td>
<td>R315 R404 R414 R511 R603</td>
<td>6.8k</td>
<td><a href="https://wiki.adom.inc/adom/0603waf6801t5e" target="_blank" rel="noopener">adom/0603waf6801t5e</a></td>
<td><a href="https://www.lcsc.com/product-detail/C23212.html" target="_blank" rel="noopener">C23212</a></td>
</tr>
<tr>
<td><a href="https://wiki.adom.inc/adom/uniroyal-0603waf" target="_blank" rel="noopener"><img src="https://wiki.adom.inc/adom/amfm-receiver-molecule/render/docs/parts/0603waf1500t5e.png?v=0b10a8a41a" width="64" alt="0603WAF1500T5E"></a><br><strong>0603WAF1500T5E</strong><br>UNI-ROYAL(Uniroyal Elec)</td>
<td align="right">2</td>
<td>R316 R415</td>
<td>150</td>
<td><a href="https://wiki.adom.inc/adom/uniroyal-0603waf" target="_blank" rel="noopener">adom/uniroyal-0603waf</a></td>
<td><a href="https://www.lcsc.com/product-detail/C22808.html" target="_blank" rel="noopener">C22808</a></td>
</tr>
<tr>
<td><a href="https://wiki.adom.inc/adom/0603waf4702t5e" target="_blank" rel="noopener"><img src="https://wiki.adom.inc/adom/amfm-receiver-molecule/render/docs/parts/0603waf4702t5e.png?v=0b10a8a41a" width="64" alt="0603WAF4702T5E"></a><br><strong>0603WAF4702T5E</strong><br>UNI-ROYAL(Uniroyal Elec)</td>
<td align="right">5</td>
<td>R317 R515 R516 R618 R711</td>
<td>47k</td>
<td><a href="https://wiki.adom.inc/adom/0603waf4702t5e" target="_blank" rel="noopener">adom/0603waf4702t5e</a></td>
<td><a href="https://www.lcsc.com/product-detail/C25819.html" target="_blank" rel="noopener">C25819</a></td>
</tr>
<tr>
<td><a href="https://wiki.adom.inc/adom/uniroyal-0603waf" target="_blank" rel="noopener"><img src="https://wiki.adom.inc/adom/amfm-receiver-molecule/render/docs/parts/0603waf510jt5e.png?v=0b10a8a41a" width="64" alt="0603WAF510JT5E"></a><br><strong>0603WAF510JT5E</strong><br>UNI-ROYAL(Uniroyal Elec)</td>
<td align="right">1</td>
<td>R401</td>
<td>51</td>
<td><a href="https://wiki.adom.inc/adom/uniroyal-0603waf" target="_blank" rel="noopener">adom/uniroyal-0603waf</a></td>
<td><a href="https://www.lcsc.com/product-detail/C23197.html" target="_blank" rel="noopener">C23197</a></td>
</tr>
<tr>
<td><a href="https://wiki.adom.inc/adom/0603waf4700t5e" target="_blank" rel="noopener"><img src="https://wiki.adom.inc/adom/amfm-receiver-molecule/render/docs/parts/0603waf4700t5e.png?v=0b10a8a41a" width="64" alt="0603WAF4700T5E"></a><br><strong>0603WAF4700T5E</strong><br>UNI-ROYAL(Uniroyal Elec)</td>
<td align="right">3</td>
<td>R407 R705 R709</td>
<td>470</td>
<td><a href="https://wiki.adom.inc/adom/0603waf4700t5e" target="_blank" rel="noopener">adom/0603waf4700t5e</a></td>
<td><a href="https://www.lcsc.com/product-detail/C23179.html" target="_blank" rel="noopener">C23179</a></td>
</tr>
<tr>
<td><a href="https://wiki.adom.inc/adom/uniroyal-0603waf" target="_blank" rel="noopener"><img src="https://wiki.adom.inc/adom/amfm-receiver-molecule/render/docs/parts/0603waf1501t5e.png?v=0b10a8a41a" width="64" alt="0603WAF1501T5E"></a><br><strong>0603WAF1501T5E</strong><br>UNI-ROYAL(Uniroyal Elec)</td>
<td align="right">3</td>
<td>R411 R513 R517</td>
<td>1.5k</td>
<td><a href="https://wiki.adom.inc/adom/uniroyal-0603waf" target="_blank" rel="noopener">adom/uniroyal-0603waf</a></td>
<td><a href="https://www.lcsc.com/product-detail/C22843.html" target="_blank" rel="noopener">C22843</a></td>
</tr>
<tr>
<td><a href="https://wiki.adom.inc/adom/uniroyal-0603waf" target="_blank" rel="noopener"><img src="https://wiki.adom.inc/adom/amfm-receiver-molecule/render/docs/parts/0603waf1502t5e.png?v=0b10a8a41a" width="64" alt="0603WAF1502T5E"></a><br><strong>0603WAF1502T5E</strong><br>UNI-ROYAL(Uniroyal Elec)</td>
<td align="right">1</td>
<td>R504</td>
<td>15k</td>
<td><a href="https://wiki.adom.inc/adom/uniroyal-0603waf" target="_blank" rel="noopener">adom/uniroyal-0603waf</a></td>
<td><a href="https://www.lcsc.com/product-detail/C22809.html" target="_blank" rel="noopener">C22809</a></td>
</tr>
<tr>
<td><a href="https://wiki.adom.inc/adom/uniroyal-0603waf" target="_blank" rel="noopener"><img src="https://wiki.adom.inc/adom/amfm-receiver-molecule/render/docs/parts/0603waf5601t5e.png?v=0b10a8a41a" width="64" alt="0603WAF5601T5E"></a><br><strong>0603WAF5601T5E</strong><br>UNI-ROYAL(Uniroyal Elec)</td>
<td align="right">1</td>
<td>R505</td>
<td>5.6k</td>
<td><a href="https://wiki.adom.inc/adom/uniroyal-0603waf" target="_blank" rel="noopener">adom/uniroyal-0603waf</a></td>
<td><a href="https://www.lcsc.com/product-detail/C23189.html" target="_blank" rel="noopener">C23189</a></td>
</tr>
<tr>
<td><a href="https://wiki.adom.inc/adom/uniroyal-0603waf" target="_blank" rel="noopener"><img src="https://wiki.adom.inc/adom/amfm-receiver-molecule/render/docs/parts/0603waf1200t5e.png?v=0b10a8a41a" width="64" alt="0603WAF1200T5E"></a><br><strong>0603WAF1200T5E</strong><br>UNI-ROYAL(Uniroyal Elec)</td>
<td align="right">1</td>
<td>R507</td>
<td>120</td>
<td><a href="https://wiki.adom.inc/adom/uniroyal-0603waf" target="_blank" rel="noopener">adom/uniroyal-0603waf</a></td>
<td><a href="https://www.lcsc.com/product-detail/C22787.html" target="_blank" rel="noopener">C22787</a></td>
</tr>
<tr>
<td><a href="https://wiki.adom.inc/adom/uniroyal-0603waf" target="_blank" rel="noopener"><img src="https://wiki.adom.inc/adom/amfm-receiver-molecule/render/docs/parts/0603waf2701t5e.png?v=0b10a8a41a" width="64" alt="0603WAF2701T5E"></a><br><strong>0603WAF2701T5E</strong><br>UNI-ROYAL(Uniroyal Elec)</td>
<td align="right">1</td>
<td>R601</td>
<td>2.7k</td>
<td><a href="https://wiki.adom.inc/adom/uniroyal-0603waf" target="_blank" rel="noopener">adom/uniroyal-0603waf</a></td>
<td><a href="https://www.lcsc.com/product-detail/C13167.html" target="_blank" rel="noopener">C13167</a></td>
</tr>
<tr>
<td><a href="https://wiki.adom.inc/adom/uniroyal-0603waf" target="_blank" rel="noopener"><img src="https://wiki.adom.inc/adom/amfm-receiver-molecule/render/docs/parts/0603waf2001t5e.png?v=0b10a8a41a" width="64" alt="0603WAF2001T5E"></a><br><strong>0603WAF2001T5E</strong><br>UNI-ROYAL(Uniroyal Elec)</td>
<td align="right">2</td>
<td>R607 R612</td>
<td>2k</td>
<td><a href="https://wiki.adom.inc/adom/uniroyal-0603waf" target="_blank" rel="noopener">adom/uniroyal-0603waf</a></td>
<td><a href="https://www.lcsc.com/product-detail/C22975.html" target="_blank" rel="noopener">C22975</a></td>
</tr>
<tr>
<td><a href="https://wiki.adom.inc/adom/uniroyal-0603waf" target="_blank" rel="noopener"><img src="https://wiki.adom.inc/adom/amfm-receiver-molecule/render/docs/parts/0603waf3302t5e.png?v=0b10a8a41a" width="64" alt="0603WAF3302T5E"></a><br><strong>0603WAF3302T5E</strong><br>UNI-ROYAL(Uniroyal Elec)</td>
<td align="right">3</td>
<td>R613 R703 R707</td>
<td>33k</td>
<td><a href="https://wiki.adom.inc/adom/uniroyal-0603waf" target="_blank" rel="noopener">adom/uniroyal-0603waf</a></td>
<td><a href="https://www.lcsc.com/product-detail/C4216.html" target="_blank" rel="noopener">C4216</a></td>
</tr>
<tr>
<td><a href="https://wiki.adom.inc/adom/uniroyal-0603waf" target="_blank" rel="noopener"><img src="https://wiki.adom.inc/adom/amfm-receiver-molecule/render/docs/parts/0603waf3902t5e.png?v=0b10a8a41a" width="64" alt="0603WAF3902T5E"></a><br><strong>0603WAF3902T5E</strong><br>UNI-ROYAL(Uniroyal Elec)</td>
<td align="right">1</td>
<td>R621</td>
<td>39k</td>
<td><a href="https://wiki.adom.inc/adom/uniroyal-0603waf" target="_blank" rel="noopener">adom/uniroyal-0603waf</a></td>
<td><a href="https://www.lcsc.com/product-detail/C23153.html" target="_blank" rel="noopener">C23153</a></td>
</tr>
<tr>
<td><a href="https://wiki.adom.inc/adom/0603waf5102t5e" target="_blank" rel="noopener"><img src="https://wiki.adom.inc/adom/amfm-receiver-molecule/render/docs/parts/0603waf5102t5e.png?v=0b10a8a41a" width="64" alt="0603WAF5102T5E"></a><br><strong>0603WAF5102T5E</strong><br>UNI-ROYAL(Uniroyal Elec)</td>
<td align="right">1</td>
<td>R718</td>
<td>51k</td>
<td><a href="https://wiki.adom.inc/adom/0603waf5102t5e" target="_blank" rel="noopener">adom/0603waf5102t5e</a></td>
<td><a href="https://www.lcsc.com/product-detail/C23196.html" target="_blank" rel="noopener">C23196</a></td>
</tr>
<tr>
<td><a href="https://wiki.adom.inc/adom/uniroyal-0603waf" target="_blank" rel="noopener"><img src="https://wiki.adom.inc/adom/amfm-receiver-molecule/render/docs/parts/0603waf2003t5e.png?v=0b10a8a41a" width="64" alt="0603WAF2003T5E"></a><br><strong>0603WAF2003T5E</strong><br>UNI-ROYAL(Uniroyal Elec)</td>
<td align="right">1</td>
<td>R720</td>
<td>200k</td>
<td><a href="https://wiki.adom.inc/adom/uniroyal-0603waf" target="_blank" rel="noopener">adom/uniroyal-0603waf</a></td>
<td><a href="https://www.lcsc.com/product-detail/C25811.html" target="_blank" rel="noopener">C25811</a></td>
</tr>
<tr>
<td><a href="https://wiki.adom.inc/adom/uniroyal-0603waf" target="_blank" rel="noopener"><img src="https://wiki.adom.inc/adom/amfm-receiver-molecule/render/docs/parts/0603waf1201t5e.png?v=0b10a8a41a" width="64" alt="0603WAF1201T5E"></a><br><strong>0603WAF1201T5E</strong><br>UNI-ROYAL(Uniroyal Elec)</td>
<td align="right">1</td>
<td>R725</td>
<td>1.2k</td>
<td><a href="https://wiki.adom.inc/adom/uniroyal-0603waf" target="_blank" rel="noopener">adom/uniroyal-0603waf</a></td>
<td><a href="https://www.lcsc.com/product-detail/C22765.html" target="_blank" rel="noopener">C22765</a></td>
</tr>
<tr>
<td><a href="https://wiki.adom.inc/adom/uniroyal-0603waf" target="_blank" rel="noopener"><img src="https://wiki.adom.inc/adom/amfm-receiver-molecule/render/docs/parts/0603waf4301t5e.png?v=0b10a8a41a" width="64" alt="0603WAF4301T5E"></a><br><strong>0603WAF4301T5E</strong><br>UNI-ROYAL(Uniroyal Elec)</td>
<td align="right">1</td>
<td>R726</td>
<td>4.3k</td>
<td><a href="https://wiki.adom.inc/adom/uniroyal-0603waf" target="_blank" rel="noopener">adom/uniroyal-0603waf</a></td>
<td><a href="https://www.lcsc.com/product-detail/C23159.html" target="_blank" rel="noopener">C23159</a></td>
</tr>
<tr>
<td><a href="https://wiki.adom.inc/ray/usblc6-2sc6" target="_blank" rel="noopener"><img src="https://wiki.adom.inc/adom/amfm-receiver-molecule/render/docs/parts/usblc6-2sc6.png?v=d77f0d4fc4" width="64" alt="USBLC6-2SC6"></a><br><strong>USBLC6-2SC6</strong><br>STMicroelectronics</td>
<td align="right">1</td>
<td>U101</td>
<td>USBLC6-2SC6</td>
<td><a href="https://wiki.adom.inc/ray/usblc6-2sc6" target="_blank" rel="noopener">ray/usblc6-2sc6</a></td>
<td><a href="https://www.lcsc.com/product-detail/C7519.html" target="_blank" rel="noopener">C7519</a></td>
</tr>
<tr>
<td><a href="https://wiki.adom.inc/adom/ap2112k-3-3trg1" target="_blank" rel="noopener"><img src="https://wiki.adom.inc/adom/amfm-receiver-molecule/render/docs/parts/ap2112k-3.3trg1.png?v=921438b00f" width="64" alt="AP2112K-3.3TRG1"></a><br><strong>AP2112K-3.3TRG1</strong><br>Diodes Incorporated</td>
<td align="right">1</td>
<td>U102</td>
<td>AP2112K-3.3</td>
<td><a href="https://wiki.adom.inc/adom/ap2112k-3-3trg1" target="_blank" rel="noopener">adom/ap2112k-3-3trg1</a></td>
<td><a href="https://www.lcsc.com/product-detail/C51118.html" target="_blank" rel="noopener">C51118</a></td>
</tr>
<tr>
<td><a href="https://wiki.adom.inc/adom/stm32g0b1ccu7" target="_blank" rel="noopener"><img src="https://wiki.adom.inc/adom/amfm-receiver-molecule/render/docs/parts/stm32g0b1ccu7.png?v=ab88e124c7" width="64" alt="STM32G0B1CCU7"></a><br><strong>STM32G0B1CCU7</strong><br>STMicroelectronics</td>
<td align="right">1</td>
<td>U103</td>
<td>STM32G0B1CCU7</td>
<td><a href="https://wiki.adom.inc/adom/stm32g0b1ccu7" target="_blank" rel="noopener">adom/stm32g0b1ccu7</a></td>
<td><a href="https://www.lcsc.com/product-detail/C29759424.html" target="_blank" rel="noopener">C29759424</a></td>
</tr>
<tr>
<td><a href="https://wiki.adom.inc/adom/tlv9062idr" target="_blank" rel="noopener"><img src="https://wiki.adom.inc/adom/amfm-receiver-molecule/render/docs/parts/tlv9062idr.png?v=29f1b9c56a" width="64" alt="TLV9062IDR"></a><br><strong>TLV9062IDR</strong><br>Texas Instruments</td>
<td align="right">4</td>
<td>U201 U202 U601 U701</td>
<td>TLV9062IDR</td>
<td><a href="https://wiki.adom.inc/adom/tlv9062idr" target="_blank" rel="noopener">adom/tlv9062idr</a></td>
<td><a href="https://www.lcsc.com/product-detail/C398355.html" target="_blank" rel="noopener">C398355</a></td>
</tr>
<tr>
<td><a href="https://wiki.adom.inc/adom/sx32y040000bc1t001" target="_blank" rel="noopener"><img src="https://wiki.adom.inc/adom/amfm-receiver-molecule/render/docs/parts/sx32y040000bc1t001.png?v=19418e9eee" width="64" alt="SX32Y040000BC1T001"></a><br><strong>SX32Y040000BC1T001</strong><br>TKD</td>
<td align="right">1</td>
<td>Y101</td>
<td>40MHz</td>
<td><a href="https://wiki.adom.inc/adom/sx32y040000bc1t001" target="_blank" rel="noopener">adom/sx32y040000bc1t001</a></td>
<td><a href="https://www.lcsc.com/product-detail/C337678.html" target="_blank" rel="noopener">C337678</a></td>
</tr>
<tr>
<td><a href="https://wiki.adom.inc/adom/0132m4-10-240f12dzng" target="_blank" rel="noopener"><img src="https://wiki.adom.inc/adom/amfm-receiver-molecule/render/docs/parts/0132m4-10.240f12dzng.png?v=c7ea362613" width="64" alt="0132M4-10.240F12DZNG"></a><br><strong>0132M4-10.240F12DZNG</strong><br>HCI</td>
<td align="right">1</td>
<td>Y501</td>
<td>10.24MHz</td>
<td><a href="https://wiki.adom.inc/adom/0132m4-10-240f12dzng" target="_blank" rel="noopener">adom/0132m4-10-240f12dzng</a></td>
<td><a href="https://www.lcsc.com/product-detail/C51822681.html" target="_blank" rel="noopener">C51822681</a></td>
</tr>
<tr>
<td><a href="https://wiki.adom.inc/adom/machinecontactmedium" target="_blank" rel="noopener"><img src="https://wiki.adom.inc/adom/amfm-receiver-molecule/render/docs/parts/machinecontactmedium.png?v=af264c521c" width="64" alt="MachineContactMedium"></a><br><strong>MachineContactMedium</strong><br>Adom</td>
<td align="right">28</td>
<td>MC1 MC2 MC3 MC4 MC5 MC6 MC7 MC8 MC9 MC10 MC11 MC12 MC13 MC14 MC15 MC16 MC17 MC18 MC19 MC20 MC21 MC22 MC23 MC24 MC25 MC26 MC27 MC28</td>
<td>MachineContactMedium</td>
<td><a href="https://wiki.adom.inc/adom/machinecontactmedium" target="_blank" rel="noopener">adom/machinecontactmedium</a></td>
<td>not on JLC (pressed in by the Adom Electronics Prototyping Cloud Lab)</td>
</tr>
<tr>
<td><a href="https://wiki.adom.inc/adom/machinepinlargestandard" target="_blank" rel="noopener"><img src="https://wiki.adom.inc/adom/amfm-receiver-molecule/render/docs/parts/machinepinlargestandard.png?v=e15acf594e" width="64" alt="MachinePinLargeStandard"></a><br><strong>MachinePinLargeStandard</strong><br>Adom</td>
<td align="right">4</td>
<td>MP1 MP2 MP3 MP4</td>
<td>MachinePinLargeStandard</td>
<td><a href="https://wiki.adom.inc/adom/machinepinlargestandard" target="_blank" rel="noopener">adom/machinepinlargestandard</a></td>
<td>not on JLC (pressed in by the Adom Electronics Prototyping Cloud Lab)</td>
</tr>
</tbody></table></div>
<ol>
<li>CL21A475KAQNNNE on <a href="https://wiki.adom.inc/adom/cl21a475kaqnnng" target="_blank" rel="noopener">adom/cl21a475kaqnnng</a>: page is the CL21A475KAQNNNG reel variant; same part, different packaging suffix</li>
<li>BAT54S on <a href="https://wiki.adom.inc/adom/bat54s" target="_blank" rel="noopener">adom/bat54s</a>: page is the Diodes Inc BAT54S; we order the MDD BAT54S (same SOT-23 pinout)</li>
<li>MMBT3906 2A(RANGE:100-300) on <a href="https://wiki.adom.inc/adom/mmbt3906" target="_blank" rel="noopener">adom/mmbt3906</a>: page is the Diodes Inc MMBT3906; we order the CJ MMBT3906 (same SOT-23 pinout)</li>
<li>MMBT3904(RANGE:100-300) on <a href="https://wiki.adom.inc/adom/mmbt3904" target="_blank" rel="noopener">adom/mmbt3904</a>: page is the Diodes Inc MMBT3904; we order the CJ MMBT3904 (same SOT-23 pinout)</li>
</ol>
<p><strong>Two parts to check in the JLC placement preview:</strong></p>
<ul>
<li><strong>FL601</strong> (HCCF2-455.000-LTWCGL) is not symmetric: pins 1 and 2 are the signal pins and 3 and 4 are ground. Rotated 180 degrees, the 455 kHz signal lands on ground. Its <a href="https://wiki.adom.inc/adom/hccf2-455-000-ltwcgl" target="_blank" rel="noopener">part page</a> shows pin 1.</li>
<li><strong>D301, D302, D401</strong> (BB910 varactors): the Shikues datasheet does not label the terminals, so the footprint assumes the standard cathode-band pinning. Confirm the band on the first parts. See the <a href="https://wiki.adom.inc/adom/bb910" target="_blank" rel="noopener">BB910 page</a>.</li>
</ul>
<p>A KiCad 10 project for a USB-powered AM/FM broadcast receiver. The radio itself is built from discrete
transistors (MMBTH10 / MMBT3904 / BC847BS) and TLV9062 op-amps.</p>
<p>An onboard STM32G0B1 does all the digital work:</p>
<ul>
<li>It tunes the varactor oscillators, switches bands, calibrates the receiver itself, and reads the demodulated audio with its ADC.</li>
<li>It streams that audio to a PC as a USB Audio Class device.</li>
<li>It takes every setting, and every firmware update, over the same USB-C cable. No other board is needed.</li>
</ul>
<div class="scroll-x"><table>
<thead>
<tr>
<th>Item</th>
<th>Value</th>
</tr>
</thead>
<tbody><tr>
<td>Bands</td>
<td>FM 87.5 to 108 MHz, AM (MW) 530 to 1700 kHz</td>
</tr>
<tr>
<td>Architecture</td>
<td>Dual-conversion superhet: 10.7 MHz first IF (both bands), 455 kHz second IF</td>
</tr>
<tr>
<td>Detectors</td>
<td>AM: diode envelope detector with op-amp AGC. FM: diode-pump pulse-count discriminator</td>
</tr>
<tr>
<td>Tuning</td>
<td>Varactor VCOs driven by the STM32 DACs (12-bit), digital AFC through an IF counter, and self-calibration against crystal-derived markers</td>
</tr>
<tr>
<td>Control & programming</td>
<td>USB-C only: UAC audio, a CDC command port, and USB DFU (a blank chip boots into ROM DFU; updates need no jumper)</td>
</tr>
<tr>
<td>Interface</td>
<td>USB-C (power, audio, control, firmware), SMA antenna, 4 LEDs. 4 grounded large Adom machine pins + 28 medium machine contacts (optional: VIN, USB, SWD/reset, UART, audio out, antenna, probes)</td>
</tr>
<tr>
<td>Debug</td>
<td>59 labelled test pads covering every supply rail, stage bias and signal node, plus 9 probe contacts</td>
</tr>
<tr>
<td>PCB</td>
<td>Adom Molecule, 96 × 96 mm large-pin grid (102.5 × 102.5 mm outline), 4 layers (F.Cu signal / In1 GND / In2 +5VA & +3V3 / B.Cu signal), JLCPCB rules</td>
</tr>
</tbody></table></div>
</details>
<details class="fold" open><summary><h2 id="verification-status-kicad-100">Verification status (KiCad 10.0)<svg class="chev" viewBox="0 0 24 24" aria-hidden="true"><path d="M8 10l4 4 4-4" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg></h2></summary>
<ul>
<li><strong>Netlist:</strong> the schematic's exported netlist matches <code>tools/design.py</code> pin for pin (403 parts including 32 machine pins/contacts and 59 test pads; 155 nets). <code>tools/check_sch.py</code> checks this.</li>
<li><strong>ERC:</strong> 0 errors, 0 warnings (all severities).</li>
<li><strong>DRC:</strong> 0 violations (all severities), 0 unconnected items, 0 schematic-parity issues.</li>
<li><strong>Board:</strong> 403 footprints, 1,974 track segments (≈4.5 m), 976 vias, 4 copper layers, 102.5 × 102.5 mm molecule outline.</li>
<li><strong>Not verified:</strong> RF performance. Oscillator ranges, IF gains and filter terminations are hand calculations. Expect to trim the tank capacitors during bring-up (see below). No SPICE or EM simulation was run.</li>
</ul>
</details>
<details class="fold" open><summary><h2 id="board-layout-and-silkscreen">Board layout and silkscreen<svg class="chev" viewBox="0 0 24 24" aria-hidden="true"><path d="M8 10l4 4 4-4" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg></h2></summary>
<p>The layout is floorplanned by function (<code>tools/floorplan.py</code>).</p>
<ul>
<li>Every circuit block has its own rectangle on the board, and the silkscreen outlines each one with its function written into the top edge.</li>
<li>Signal flow runs from the antenna (top right), through the front ends (right column) and the 10.7 MHz and 455 kHz IFs (middle column), to the MCU (left column).</li>
<li>The left column stacks USB/power, the MCU, the LDO and the LED / audio-out block. All their contacts form one column down the left edge.</li>
<li>Tuning sits bottom right, so only five slow DC control lines (two DACs, the PWM and two band enables) cross the IF column.</li>
<li>Inside each block, parts sit on a 0.5 mm grid, prefer a common orientation, and are pulled onto shared rows and columns.</li>
</ul>
<p>The silkscreen is kept clean:</p>
<ul>
<li><strong>Reference designators:</strong> none on the silkscreen. They are on the F.Fab layer, so KiCad's assembly view and the schematic still cross-reference.</li>
<li><strong>Part outlines:</strong> passives and discretes have none.</li>
<li><strong>What remains:</strong> the block outlines and labels, each IC's part name, the test-pad and machine-contact signal names, the connector outlines, and the LED names.</li>
<li><strong>DRC:</strong> because footprints were edited on the board, the project sets KiCad's "footprint doesn't match library" check to <em>ignore</em>.</li>
</ul>
<div class="scroll-x"><table>
<thead>
<tr>
<th>Silkscreen group</th>
<th>Section</th>
</tr>
</thead>
<tbody><tr>
<td>USB-C / POWER IN</td>
<td>Power & MCU</td>
</tr>
<tr>
<td>STM32 MCU</td>
<td>Power & MCU</td>
</tr>
<tr>
<td>3.3 V LDO / RAILS</td>
<td>Power & MCU</td>
</tr>
<tr>
<td>10.24 MHz XO</td>
<td>10.7 MHz IF</td>
</tr>
<tr>
<td>10.7 MHz IF AMP</td>
<td>10.7 MHz IF</td>
</tr>
<tr>
<td>2ND MIXER</td>
<td>10.7 MHz IF</td>
</tr>
<tr>
<td>10.7 MHz FILTER</td>
<td>10.7 MHz IF</td>
</tr>
<tr>
<td>455 kHz AM FILTER</td>
<td>AM IF</td>
</tr>
<tr>
<td>AGC VGA</td>
<td>AM IF</td>
</tr>
<tr>
<td>AGC / RSSI / AM AUDIO</td>
<td>AM IF</td>
</tr>
<tr>
<td>IF AMP / AM DETECTOR</td>
<td>AM IF</td>
</tr>
<tr>
<td>FM LIMITER</td>
<td>FM IF</td>
</tr>
<tr>
<td>FM RSSI</td>
<td>FM IF</td>
</tr>
<tr>
<td>SQUARER / IF COUNT</td>
<td>FM IF</td>
</tr>
<tr>
<td>AFC / FM AUDIO</td>
<td>FM IF</td>
</tr>
<tr>
<td>FM DISCRIMINATOR</td>
<td>FM IF</td>
</tr>
<tr>
<td>FM MIXER</td>
<td>FM front end</td>
</tr>
<tr>
<td>FM LO</td>
<td>FM front end</td>
</tr>
<tr>
<td>FM RF AMP</td>
<td>FM front end</td>
</tr>
<tr>
<td>ANT / DIPLEXER</td>
<td>FM front end</td>
</tr>
<tr>
<td>AM MIXER</td>
<td>AM front end</td>
</tr>
<tr>
<td>AM LO</td>
<td>AM front end</td>
</tr>
<tr>
<td>AM RF AMP</td>
<td>AM front end</td>
</tr>
<tr>
<td>VARACTOR DRIVE</td>
<td>Tuning & UI</td>
</tr>
<tr>
<td>RF TRACKING / VREF</td>
<td>Tuning & UI</td>
</tr>
<tr>
<td>BAND SWITCH</td>
<td>Tuning & UI</td>
</tr>
<tr>
<td>ENCODER / LEDS / AUDIO</td>
<td>Tuning & UI</td>
</tr>
</tbody></table></div>
</details>
<details class="fold" open><summary><h2 id="adom-molecule">Adom Molecule<svg class="chev" viewBox="0 0 24 24" aria-hidden="true"><path d="M8 10l4 4 4-4" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg></h2></summary>
<p>This board follows Adom's <a href="https://wiki.adom.inc/adom/molecule-design-guide" target="_blank" rel="noopener">Molecule Design Guide</a> (white paper v1.0) and uses the official parts from <a href="https://wiki.adom.inc/adom/adom-machine-parts-library" target="_blank" rel="noopener">adom/adom-machine-parts-library</a>. The KiCad copies are in <code>lib/AdomMachine.*</code>, with STEP models from the component pages.</p>
<div class="scroll-x"><table>
<thead>
<tr>
<th>Rule</th>
<th>This molecule</th>
</tr>
</thead>
<tbody><tr>
<td>Machine pin in every corner (pincer grip)</td>
<td>4× <strong>MachinePinLargeStandard</strong> (Ø3.45 mm plated hole, 5.2 mm pad), all four on <strong>GND</strong>, <strong>96 × 96 mm</strong> apart. That is 3 × 3 cells of the 32 mm large-class grid, so the molecule mounts directly on the base scaffold without a user scaffold. Large Standard is the only large pin Adom makes.</td>
</tr>
<tr>
<td>Contacts</td>
<td>All 28 are <strong>MachineContactMedium</strong>, the smaller of Adom's two contact sizes: 0.78 mm drill, 1.3 mm pad, 24 AWG wire. None is closer than 6 mm to a large pin; the pins' 3 mm-radius courtyard is the pincer keep-out.</td>
</tr>
<tr>
<td>All pins/contacts on the 2 mm grid from the origin pin</td>
<td>MP1 is the origin (KiCad drill/place and grid origin). Every machine contact is at an even-mm offset from MP1, and the probe contacts were snapped to that lattice by the placer.</td>
</tr>
<tr>
<td>Board outline</td>
<td>102.5 × 102.5 mm: 3.25 mm beyond the pin centres, with corner arcs centred on the pins (no wings). That is the large pin's 2.6 mm pad radius plus the 0.65 mm edge clearance Adom's example molecules use.</td>
</tr>
<tr>
<td>Connections via machine pins/contacts</td>
<td>Power, USB, SWD/reset, UART, audio and antenna are on edge contacts, but none is required: USB-C alone runs the board. The only connectors are the USB-C (the pincers can plug USB) and the SMA jack.</td>
</tr>
<tr>
<td>Jumpers instead of buttons</td>
<td>No buttons and no jumpers are needed. Firmware updates use USB DFU: a blank chip boots into it, and the firmware re-enters it on request. For recovery from a broken image, <strong>CLK(=BOOT0) + 3V3</strong> and <strong>RST + GND</strong> are adjacent contact pairs a machine-pin jumper can bridge.</td>
</tr>
<tr>
<td>Self-contained</td>
<td>The full radio, MCU, crystal timebase, regulators and decoupling are on board. Tuning, band, volume, calibration and updates are all controlled from the PC over USB-C, with no external controls.</td>
</tr>
</tbody></table></div>
<h3 id="machine-pin-and-contact-map">Machine pin and contact map</h3>
<p>Grid coordinates are mm from MP1; +x is right and +y is down, as seen in KiCad.</p>
<div class="scroll-x"><table>
<thead>
<tr>
<th>Ref</th>
<th>Net</th>
<th>Silk label</th>
<th>Grid (x, y)</th>
</tr>
</thead>
<tbody><tr>
<td>MP1</td>
<td><code>GND</code></td>
<td>corner machine pin (large)</td>
<td>(0, 0)</td>
</tr>
<tr>
<td>MP2</td>
<td><code>GND</code></td>
<td>corner machine pin (large)</td>
<td>(96, 0)</td>
</tr>
<tr>
<td>MP3</td>
<td><code>GND</code></td>
<td>corner machine pin (large)</td>
<td>(0, 96)</td>
</tr>
<tr>
<td>MP4</td>
<td><code>GND</code></td>
<td>corner machine pin (large)</td>
<td>(96, 96)</td>
</tr>
<tr>
<td>MC1</td>
<td><code>VIN</code></td>
<td>5V</td>
<td>(0, 6)</td>
</tr>
<tr>
<td>MC2</td>
<td><code>GND</code></td>
<td>GND</td>
<td>(0, 8)</td>
</tr>
<tr>
<td>MC3</td>
<td><code>USB_DP</code></td>
<td>D+</td>
<td>(0, 24)</td>
</tr>
<tr>
<td>MC4</td>
<td><code>USB_DM</code></td>
<td>D-</td>
<td>(0, 26)</td>
</tr>
<tr>
<td>MC5</td>
<td><code>GND</code></td>
<td>GND</td>
<td>(0, 28)</td>
</tr>
<tr>
<td>MC6</td>
<td><code>+3V3</code></td>
<td>3V3</td>
<td>(0, 34)</td>
</tr>
<tr>
<td>MC7</td>
<td><code>SWCLK</code></td>
<td>CLK</td>
<td>(0, 36)</td>
</tr>
<tr>
<td>MC8</td>
<td><code>NRST</code></td>
<td>RST</td>
<td>(0, 38)</td>
</tr>
<tr>
<td>MC9</td>
<td><code>GND</code></td>
<td>GND</td>
<td>(0, 40)</td>
</tr>
<tr>
<td>MC10</td>
<td><code>SWDIO</code></td>
<td>DIO</td>
<td>(0, 44)</td>
</tr>
<tr>
<td>MC11</td>
<td><code>GND</code></td>
<td>GND</td>
<td>(0, 46)</td>
</tr>
<tr>
<td>MC12</td>
<td><code>UART_TX</code></td>
<td>TX</td>
<td>(0, 52)</td>
</tr>
<tr>
<td>MC13</td>
<td><code>UART_RX</code></td>
<td>RX</td>
<td>(0, 54)</td>
</tr>
<tr>
<td>MC14</td>
<td><code>GND</code></td>
<td>GND</td>
<td>(0, 56)</td>
</tr>
<tr>
<td>MC15</td>
<td><code>AM_AUDIO</code></td>
<td>AM</td>
<td>(0, 84)</td>
</tr>
<tr>
<td>MC16</td>
<td><code>FM_AUDIO</code></td>
<td>FM</td>
<td>(0, 86)</td>
</tr>
<tr>
<td>MC17</td>
<td><code>GND</code></td>
<td>GND</td>
<td>(0, 88)</td>
</tr>
<tr>
<td>MC18</td>
<td><code>ANT</code></td>
<td>ANT</td>
<td>(96, 20)</td>
</tr>
<tr>
<td>MC19</td>
<td><code>GND</code></td>
<td>GND</td>
<td>(96, 22)</td>
</tr>
</tbody></table></div>
<p>The probe contacts (for the Cloud Lab's probe needles) sit on the grid next to their circuits: MC20 <code>CF2_OUT</code>, MC21 <code>IF2_OUT</code>, MC22 <code>AM_DET</code>, MC23 <code>FM_DEMOD</code>, MC24 <code>LIM_SQ</code>, MC25 <code>VT_FM</code>, MC26 <code>VT_AM</code>, MC27 <code>VT_RF</code>, MC28 <code>+5VA</code>.</p>
<h3 id="debug-test-points">Debug test points</h3>
<p>59 bare copper test pads, grouped by circuit. Each has its short name printed next to it on the silkscreen (the name is in brackets below).</p>
<ul>
<li>Supply, bias and ground pads are 1.5 mm, for a DMM probe or a scope ground spring. Every circuit block has its own GND pad.</li>
<li>Signal pads are 1 mm.</li>
<li>They are copper only: no part, not in the BOM or CPL, so they add nothing to the JLC order.</li>
</ul>
<div class="scroll-x"><table>
<thead>
<tr>
<th>Circuit</th>
<th>Test pads</th>
</tr>
</thead>
<tbody><tr>
<td>Power & MCU</td>
<td>TP101 <code>VBUS</code> (VBUS), TP102 <code>VIN</code> (VIN), TP103 <code>VIN_OR</code> (VOR), TP104 <code>+5V</code> (5V), TP105 <code>+3V3</code> (3V3), TP106 <code>+3.3VA</code> (3V3A), TP107 <code>+5VA</code> (5VA), TP108 <code>GND</code> (GND), TP109 <code>GND</code> (GND), TP110 <code>CAL_MARK</code> (CAL)</td>
</tr>
<tr>
<td>Tuning & band switch</td>
<td>TP201 <code>DAC_FM</code> (DACF), TP202 <code>DAC_AM</code> (DACA), TP203 <code>PWM_RF</code> (PWM), TP204 <code>VTF_OUT</code> (VTF1), TP205 <code>VTA_OUT</code> (VTA1), TP206 <code>VTR_OUT</code> (VTR1), TP207 <code>VREF_1V65</code> (VREF), TP208 <code>+5V_FM</code> (5VFM), TP209 <code>+5V_AM</code> (5VAM), TP210 <code>GND</code> (GND), TP211 <code>GND</code> (GND)</td>
</tr>
<tr>
<td>FM front end</td>
<td>TP301 <code>V_RF1</code> (VRF), TP302 <code>V_LO1</code> (VLO), TP303 <code>FMLO_E</code> (FLO), TP304 <code>IF_MIX</code> (MIX), TP305 <code>GND</code> (GND)</td>
</tr>
<tr>
<td>AM front end</td>
<td>TP401 <code>V_AM1</code> (VAM1), TP402 <code>V_AM2</code> (VAM2), TP403 <code>AM_RFIN</code> (AMIN), TP404 <code>AMRF_C</code> (ARF), TP405 <code>AMLO_E</code> (ALO), TP406 <code>GND</code> (GND)</td>
</tr>
<tr>
<td>10.7 MHz IF / 2nd mixer</td>
<td>TP501 <code>V_IF1</code> (VIF1), TP502 <code>V_IF2</code> (VIF2), TP503 <code>CF1_OUT</code> (CF1), TP504 <code>IF_C1</code> (IF1), TP505 <code>XO_E</code> (XO), TP506 <code>GND</code> (GND)</td>
</tr>
<tr>
<td>AM IF, AGC & detector</td>
<td>TP601 <code>V_IF3</code> (VIF3), TP602 <code>VBIAS</code> (VB), TP603 <code>AMF_OUT</code> (AMF), TP604 <code>VGA1_OUT</code> (VGA1), TP605 <code>VGA2_OUT</code> (VGA2), TP606 <code>AM_IFOUT</code> (AIF), TP607 <code>V_AGC</code> (AGC), TP608 <code>RSSI_AM</code> (RSA), TP609 <code>AMA_OUT</code> (AMA), TP610 <code>GND</code> (GND), TP611 <code>GND</code> (GND)</td>
</tr>
<tr>
<td>FM limiter & discriminator</td>
<td>TP701 <code>V_IF4</code> (VIF4), TP702 <code>LIM1_C</code> (LIM1), TP703 <code>LIM2_C</code> (LIM2), TP704 <code>RSSI_FM</code> (RSF), TP705 <code>IF_CNT</code> (CNT), TP706 <code>VREF_FM</code> (VRFM), TP707 <code>FM_DC</code> (FMDC), TP708 <code>FMA_OUT</code> (FMA), TP709 <code>GND</code> (GND), TP710 <code>GND</code> (GND)</td>
</tr>
</tbody></table></div>
<p>On the RF side the pads sit on low-impedance nodes (oscillator emitters, mixer output, supply rails) rather than on the tank circuits, so a probe doesn't detune them.</p>
<h3 id="using-it-in-the-adom-electronics-prototyping-cloud-lab">Using it in the Adom Electronics Prototyping Cloud Lab</h3>
<ul>
<li><strong>Mounting:</strong> the large corner pins sit on the 32 mm grid, so the molecule plugs straight into the base scaffold's large contacts.</li>
<li><strong>One cable does everything:</strong> plug USB-C into a PC.<ul>
<li>It powers the board, carries the audio (a USB microphone), accepts every tuning and settings command, and reflashes the firmware.</li>
<li>No other board, encoder, programmer or jumper is needed.</li>
</ul>
</li>
<li><strong>Optional contacts:</strong><ul>
<li><strong>VIN:</strong> 5 V from the control panel's PS2 or USB rail can come in on the VIN contact (MC1) instead of USB-C. The two are OR-ed through B5819W diodes. Current draw is about 80 mA.</li>
<li><strong>Debug:</strong> SWD (DIO/CLK/RST) and a UART console (TX/RX) are there for firmware debugging only.</li>
<li><strong>Audio:</strong> the AM/FM audio contacts (MC15/MC16) can feed another molecule or a scope.</li>
</ul>
</li>
</ul>
</details>
<details class="fold" open><summary><h2 id="signal-chain-and-frequency-plan">Signal chain and frequency plan<svg class="chev" viewBox="0 0 24 24" aria-hidden="true"><path d="M8 10l4 4 4-4" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg></h2></summary>
<pre><code> ┌─ 2 MHz LPF ─ AM preamp (Q401) ─ AM mixer (Q403) ◄─ AM VCO 11.23 to 12.4 MHz (Q402, Clapp)
SMA ─ diplexer ────┤ │
└─ 70 MHz HPF + 130 MHz LPF ─ FM RF amp (Q301, varactor-tracked tank)
─ FM mixer (Q303) ◄─ FM VCO 98.7 to 118.7 MHz (Q302, Colpitts)
│
IF_MIX (10.7 MHz, 330 Ω)
│
FL501 10.7 MHz ─ IF amp (Q501) ─ FL502 10.7 MHz ─ 2nd mixer (Q502) ◄─ 10.24 MHz XO (Q503)
│ 455 kHz
┌────────────────────────────────────┴───────────────────────────┐
AM: FL601 455 kHz ±4.5 kHz ─ VGA1/VGA2 (BC847BS pairs, FM: RC LPF ─ limiter (Q701, Q702) ─ squarer (Q703)
tail-current AGC) ─ post-amp (Q605) ─ BAT54 detector ─ diode pump (C714 + BAT54S) ─ U701A integrator
─ U601A AGC integrator ─ U601B 5 kHz Sallen-Key (75 µs de-emphasis) ─ U701B 15 kHz Sallen-Key
─► AM_AUDIO (PA0) V_AGC ─► RSSI_AM (PA2) ─► FM_AUDIO (PA1) FM_DC ─► PA3 LIM_SQ ─► IF_CNT (PA15)
</code></pre>
<ul>
<li><strong>FM</strong> uses high-side injection (LO = RF + 10.7 MHz). The RF amplifier's tank is tuned by <code>VT_RF</code> (a filtered PWM), so the firmware can track the preselector to the LO and suppress the image 21.4 MHz above.</li>
<li><strong>AM</strong> is up-converted to 10.7 MHz (LO = RF + 10.7 MHz). The image lands at 22 to 23 MHz, far beyond the 2 MHz low-pass, so no tracking preselector is needed and the VCO only has to cover a 1.1:1 range.</li>
<li>Both bands share the 10.7 MHz IF and the second conversion to 455 kHz. The second LO is a 10.240 MHz crystal (JLC-stocked; 10.245 MHz parts are scarce), so the first IF is actually <strong>10.695 MHz</strong>. Firmware sets LO1 = RF + 10.695 MHz; the offset is only 5 kHz, well inside the 10.7 MHz filters' 180 kHz passband.<ul>
<li><strong>AM:</strong> the narrow ceramic filter sets the selectivity.</li>
<li><strong>FM:</strong> the wide 10.7 MHz filters set the noise bandwidth, and the ±75 kHz deviation (16 % of 455 kHz) goes straight to the pulse-count detector.</li>
</ul>
</li>
</ul>
<h3 id="pulse-count-fm-detector">Pulse-count FM detector</h3>
<p>Each IF cycle the 0 to 4.6 V square wave (<code>LIM_SQ</code>) moves a fixed charge <code>C714 · (Vpp − 2·Vf)</code> into U701A's
summing junction, so the average current is proportional to the IF frequency:
40 µA at 455 kHz and ±6.6 µA at ±75 kHz deviation.</p>
<ul>
<li><strong>Audio and de-emphasis:</strong> R718 (51 k) converts the current to ±0.34 V of audio, and R718 ∥ C715 (51 k ∥ 1.5 nF) gives the 75 µs de-emphasis. For 50 µs (EU), change C715 to 1 nF.</li>
<li><strong>AFC:</strong> <code>FM_DC</code> (FM_DEMOD × 2/3, 0.1 s time constant) gives the firmware an AFC error signal. <code>IF_CNT</code> lets TIM2 count the IF directly.</li>
</ul>
<h3 id="am-agc">AM AGC</h3>
<p>Two BC847BS differential pairs act as variable-gain amplifiers. Their gain is proportional to the tail current, about 40 dB of range per stage.</p>
<ul>
<li><strong>Loop:</strong> U601A integrates <code>AM_DET − 0.98 V</code> and drives both tail transistors through a ÷2 divider, which holds the detected carrier at about 1 V.</li>
<li><strong>Signal strength:</strong> <code>RSSI_AM</code> (V_AGC/2) is the firmware's signal-strength reading, used for seek. It is inverted: a lower voltage means a stronger signal.</li>
</ul>
</details>
<details class="fold" open><summary><h2 id="stm32g0b1ccu7-pin-map">STM32G0B1CCU7 pin map<svg class="chev" viewBox="0 0 24 24" aria-hidden="true"><path d="M8 10l4 4 4-4" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg></h2></summary>
<p>The MCU is an STM32G0B1CCU7 (Cortex-M0+, 256 KB flash, 144 KB RAM, USB FS, dual 12-bit DAC).</p>
<p>It replaces the STM32F072 because of how a blank chip boots:</p>
<ul>
<li>The G0B1 has a flash <strong>empty check</strong>. A blank chip straight from the JLC assembly line boots into ST's ROM USB DFU bootloader.</li>
<li>The very first firmware load therefore goes over USB, just like every later update.</li>
<li>The F072 has no empty check. A blank F072 needs BOOT0 pulled high by a jumper.</li>
</ul>
<div class="scroll-x"><table>
<thead>
<tr>
<th>Pin</th>
<th>Function</th>
<th>Net</th>
</tr>
</thead>
<tbody><tr>
<td>PA0 / PA1</td>
<td>ADC_IN0 / ADC_IN1</td>
<td><code>AM_AUDIO</code> / <code>FM_AUDIO</code> (biased at 1.65 V)</td>
</tr>
<tr>
<td>PA2</td>
<td>ADC_IN2</td>
<td><code>RSSI_AM</code> (AGC voltage / 2)</td>
</tr>
<tr>
<td>PA3</td>
<td>ADC_IN3</td>
<td><code>FM_DC</code> (discriminator DC, AFC)</td>
</tr>
<tr>
<td>PA6</td>
<td>ADC_IN6</td>
<td><code>RSSI_FM</code> (limiter stage-1 detector)</td>
</tr>
<tr>
<td>PA4</td>
<td>DAC1_OUT1</td>
<td><code>DAC_FM</code> → ×1.45 → <code>VT_FM</code> (FM VCO)</td>
</tr>
<tr>
<td>PA5</td>
<td>DAC1_OUT2</td>
<td><code>DAC_AM</code> → ×1.45 → <code>VT_AM</code> (AM VCO)</td>
</tr>
<tr>
<td>PB1</td>
<td>TIM3_CH4 PWM</td>
<td><code>PWM_RF</code> → 2-pole RC → ×1.45 → <code>VT_RF</code> (FM preselector)</td>
</tr>
<tr>
<td>PA15</td>
<td>TIM2_ETR</td>
<td><code>IF_CNT</code> (limited 455 kHz IF: AFC and self-calibration)</td>
</tr>
<tr>
<td>PA8</td>
<td>TIM1_CH1</td>
<td><code>CAL_MARK</code> → 47 k + 100 pF → <code>ANT</code> (calibration markers; idles low)</td>
</tr>
<tr>
<td>PF0 / PF1</td>
<td>HSE</td>
<td>40 MHz crystal Y101. Its harmonics land at 80 and 120 MHz, clear of the FM band and the LO range.</td>
</tr>
<tr>
<td>PB8 / PB9</td>
<td>GPIO open-drain (5 V tolerant)</td>
<td><code>FM_EN_N</code> / <code>AM_EN_N</code>: low = band powered</td>
</tr>
<tr>
<td>PB13 / PB14 / PB15</td>
<td>GPIO</td>
<td><code>LED_FM</code> / <code>LED_AM</code> / <code>LED_STAT</code></td>
</tr>
<tr>
<td>PA11 / PA12</td>
<td>USB FS</td>
<td>D− / D+. USB runs on HSI48 + CRS, locked to the host's SOF.</td>
</tr>
<tr>
<td>PB6 / PB7</td>
<td>USART1 TX / RX</td>
<td><code>UART_TX</code> / <code>UART_RX</code>: optional debug console (MC12/MC13)</td>
</tr>
<tr>
<td>PA13 / PA14, PF2</td>
<td>SWD, NRST</td>
<td>Optional debug contacts DIO / CLK / RST. PA14 = SWCLK is also BOOT0 (10 k pull-down).</td>
</tr>
<tr>
<td>VREF+</td>
<td>ADC / DAC reference</td>
<td><code>+3.3VA</code> (ferrite-filtered)</td>
</tr>
</tbody></table></div>
</details>
<details class="fold" open><summary><h2 id="programming-and-control-over-usb-firmware-outline-not-yet-written">Programming and control over USB (firmware outline, not yet written)<svg class="chev" viewBox="0 0 24 24" aria-hidden="true"><path d="M8 10l4 4 4-4" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg></h2></summary>
<p>Everything runs over the one USB-C cable: power, audio, control and firmware updates.</p>
<p><strong>Programming</strong></p>
<ol>
<li><strong>First flash:</strong> a blank G0B1 enumerates as <em>STM32 BOOTLOADER</em> (USB DFU, VID 0483 / PID DF11). Flash it with <code>dfu-util -a 0 -s 0x08000000:leave -D amfm.bin</code> or STM32CubeProgrammer.<ul>
<li>The empty-flash flag is only re-read at power-on. Use <code>:leave</code>, or power-cycle once after the first flash.</li>
</ul>
</li>
<li><strong>Updates:</strong> the firmware exposes a USB <strong>DFU runtime</strong> interface, so <code>dfu-util -e</code> works.<ul>
<li>On that request (or the CDC command <code>dfu</code>), it stores a magic word in RAM and resets.</li>
<li>Its startup code sees the word and jumps to the ROM bootloader at 0x1FFF0000.</li>
<li><code>dfu-util</code> then writes the new image and leaves, with no jumper and no ST-Link.</li>
</ul>
</li>
<li><strong>Recovery</strong>, only if a broken image never answers USB: bridge <strong>CLK↔3V3</strong> (CLK is BOOT0), then <strong>RST↔GND</strong> or power-cycle. The chip comes up in ROM DFU.</li>
</ol>
<p><strong>Clocks</strong></p>
<ul>
<li>The 40 MHz crystal drives the PLL: 64 MHz SYSCLK, and 128 MHz for TIM1.</li>
<li>USB runs on HSI48 with CRS synced to SOF.</li>
<li>Every frequency the MCU generates or measures is therefore crystal-accurate (±10 ppm).</li>
</ul>
<p><strong>USB composite device</strong></p>
<ul>
<li><strong>Audio:</strong> UAC microphone, 48 kHz, 16-bit mono.<ul>
<li>TIM-triggered ADC with DMA on PA0/PA1, sending the active band.</li>
<li>The PC's volume and mute controls act on a feature unit.</li>
</ul>
</li>
<li><strong>Control:</strong> a CDC-ACM text port (mirrored on the UART console). Commands:</li>
</ul>
<div class="scroll-x"><table>
<thead>
<tr>
<th>Command</th>
<th>Action</th>
</tr>
</thead>
<tbody><tr>
<td><code>band fm</code> / <code>band am</code></td>
<td>Powers the chosen front end (<code>FM_EN_N</code> / <code>AM_EN_N</code>) and loads its tuning table.</td>
</tr>
<tr>
<td><code>freq 101.1</code> / <code>freq 1010</code></td>
<td>Tunes in MHz (FM) or kHz (AM): DAC from the calibration table, then AFC.</td>
</tr>
<tr>
<td><code>seek up</code> / <code>seek down</code>, <code>scan</code></td>
<td>Steps and stops on stations, found via RSSI plus the IF count.</td>
</tr>
<tr>
<td><code>mute</code>, <code>volume N</code>, <code>squelch N</code></td>
<td>Digital, in the audio path.</td>
</tr>
<tr>
<td><code>deemph 50</code> / <code>deemph 75</code></td>
<td>The analog chain is 75 µs; 50 µs regions get a first-order digital correction.</td>
</tr>
<tr>
<td><code>rssi?</code>, <code>status?</code></td>
<td>Signal strength, AGC voltage, IF frequency, band, frequency.</td>
</tr>
<tr>
<td><code>cal</code></td>
<td>Runs the self-calibration below and stores the tables in flash.</td>
</tr>
<tr>
<td><code>dfu</code></td>
<td>Reboots into the ROM DFU bootloader.</td>
</tr>
</tbody></table></div>
<p><strong>Tuning</strong></p>
<ul>
<li>A per-band table maps DAC code to LO frequency; a second table maps FM frequency to the <code>VT_RF</code> preselector PWM.</li>
<li>After each tune, AFC counts <code>IF_CNT</code> for 10 ms against 455.000 kHz and trims the DAC code.</li>
</ul>
<p><strong>Self-calibration (<code>cal</code>: no signal generator, probe or SDR needed)</strong></p>
<ol>
<li><strong>Markers:</strong> TIM1 drives <code>CAL_MARK</code> with a square wave of 128 MHz / N.<ul>
<li>Its harmonics reach the antenna input through 47 kΩ and 100 pF, at about −60 dBm each.</li>
<li>Example: N = 13 gives markers at 88.6, 98.5 and 108.3 MHz. AM uses the fundamental directly, for example 600 / 1000 / 1400 kHz.</li>
</ul>
</li>
<li><strong>Find each marker:</strong> sweep the DAC until the IF counter sees it.</li>
<li><strong>Compute the LO:</strong> LO = f_marker + 10.240 MHz + f_IF2, where f_IF2 is the counted IF.<ul>
<li>The MCU's crystal sets f_marker and the gate time. The ±20 ppm 10.24 MHz crystal sets the second LO.</li>
</ul>
</li>
<li><strong>Build the table:</strong> a few markers per band give a DAC → LO table accurate to a few kHz.<ul>
<li>It also checks that each VCO covers its band (98.7 to 118.7 MHz and 11.23 to 12.4 MHz) and reports if it doesn't.</li>
</ul>
</li>
<li><strong>Preselector:</strong> with a marker in view, sweep the <code>VT_RF</code> PWM for maximum <code>RSSI_FM</code> to build the tracking table.</li>
<li><strong>Idle:</strong> the marker pin idles low, so nothing is injected during normal reception.</li>
</ol>
</details>
<details class="fold" open><summary><h2 id="bring-up-and-alignment">Bring-up and alignment<svg class="chev" viewBox="0 0 24 24" aria-hidden="true"><path d="M8 10l4 4 4-4" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg></h2></summary>
<ol>
<li><strong>Rails:</strong> power from USB and check the test pads VBUS, VOR, 5V, 3V3, 3V3A and 5VA. The board enumerates as <em>STM32 BOOTLOADER</em>; flash the firmware over USB.<ul>
<li>Check each stage's bias rail too: VRF, VLO, VAM1, VAM2, VIF1-VIF4 and VB. Every block has a GND pad next to it.</li>
</ul>
</li>
<li><strong>Band power:</strong> send <code>band fm</code> and check <code>+5V_FM</code> ≈ 4.9 V (pad 5VFM); then <code>band am</code> (pad 5VAM). The DAC outputs are at DACF/DACA and the op-amp outputs at VTF1/VTA1/VTR1.</li>
<li><strong>Self-calibration:</strong> run <code>cal</code>. The firmware reports each VCO's measured range and builds its tables. The CAL pad shows the marker square wave while it runs.<ul>
<li>If a range misses the band, adjust C319 (FM) or C410 (AM) to shift it. Adjust C320 / C411 to change its width.</li>
</ul>
</li>
<li><strong>Crystal oscillator:</strong> check 10.240 MHz at pad XO. With a marker tuned in, 455 kHz appears at probe contact 455K (MC21) and 10.7 MHz at 10M7 (MC20).</li>
<li><strong>FM detector:</strong> probe SQ (MC24) should show a clean square wave. <code>FM_DEMOD</code> (probe DEM, MC23) sits near 1.8 V with an unmodulated IF.</li>
<li><strong>AM chain:</strong> follow the signal through the pads AMF → VGA1 → VGA2 → AIF → DET (MC22) → AMA, with AGC showing the control voltage.</li>
</ol>
</details>
<details class="fold" open><summary><h2 id="ordering-from-jlcpcb">Ordering from JLCPCB<svg class="chev" viewBox="0 0 24 24" aria-hidden="true"><path d="M8 10l4 4 4-4" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg></h2></summary>
<p>Every BOM line has an in-stock JLCPCB part (LCSC number), checked against JLCPCB's parts API on 2026-09-29: 86 line items, 312 placed parts. Of those lines, 46 are Basic, 4 Preferred Extended and 36 Extended. Parts cost about $11 per board, and each Extended line adds JLC's per-order Extended-part fee.</p>
<ol>
<li><strong>PCB:</strong> upload <code>fab/amfm_receiver_gerbers.zip</code> (Gerbers + drill, origin at MP1, the top-left corner pin). Settings:<ul>
<li>4 layers, 102.5 × 102.5 mm, 1.6 mm. The corner pin holes are 3.45 mm plated through-holes.</li>
<li>Optionally, the impedance-controlled stackup <strong>JLC04161H-7628</strong>. The RF-netclass traces are 0.36 mm, about 50 Ω over the In1 ground plane.</li>
</ul>
</li>
<li><strong>Assembly:</strong> top side only. Upload <code>fab/amfm_receiver_BOM_JLCPCB.csv</code> (Comment, Designator, Footprint, LCSC Part #) and <code>fab/amfm_receiver_CPL_JLCPCB.csv</code> (Designator, Mid X, Mid Y, Layer, Rotation).<ul>
<li>The SMA jack (J301) is the only through-hole part JLC fits: choose <em>Standard</em> PCBA, or leave it out and hand-solder it.</li>
<li>The machine pins (MP1-MP4) and machine contacts (MC1-MC28) are <strong>not</strong> in the JLC files: JLC only drills their plated holes, and the Adom Electronics Prototyping Cloud Lab presses the pins and contacts in.</li>
<li>The 59 test pads (TP…) are bare copper and are not in the BOM or CPL either.</li>
</ul>
</li>
<li><strong>Check the placement preview before paying.</strong> CPL rotations were converted from KiCad to JLC orientation with the JLCKicadTools correction table.<ul>
<li>Confirm pin 1 or polarity on U103 (QFN-48), U101/U102, U201/U202/U601/U701 (SOIC-8), the SOT-23 and SOT-363 transistors, and the diodes/varactors (D301, D302, D401, D601, D701, D702). Also check the LEDs, the crystals Y101/Y501 and the three ceramic filters.</li>
<li>Any part the preview shows rotated can be fixed in the order page.</li>
</ul>
</li>
</ol>
<h3 id="parts-that-differ-from-a-generic-design">Parts that differ from a generic design</h3>
<ul>
<li><strong>MCU:</strong> <strong>STM32G0B1CCU7</strong> (C29759424, QFN-48). It was chosen over the STM32F072 because its flash empty check boots a blank chip into ROM USB DFU, so programming never needs a jumper or an ST-Link.<ul>
<li>The exposed pad uses KiCad's thermal-via land pattern, which ties it to the inner ground plane.</li>
</ul>
</li>
<li><strong>MCU crystal:</strong> 40 MHz <strong>SX32Y040000BC1T001</strong> (C337678, 12 pF load, 20 Ω ESR), with 18 pF C0G loads.<ul>
<li>40 MHz puts the crystal's harmonics at 80 and 120 MHz, outside the FM band and the 98.7 to 118.7 MHz LO range.</li>
<li>The low ESR keeps the crystal's critical gm at about 1.1 mA/V, inside the G0's 1.5 mA/V start-up limit.</li>
</ul>
</li>
<li><strong>Ceramic filters:</strong> SMD parts JLC stocks.<ul>
<li>FL501/FL502: HCI <strong>HCCF3-10.700-LTCVS3L</strong> (C19191232), 7.0 × 3.0 mm, 180 kHz.</li>
<li>FL601: <strong>HCCF2-455.000-LTWCGL</strong> (C19186014), ±4.5 kHz.</li>
<li>Footprints are in <code>lib/AMFM.pretty</code>, built from LCSC's land patterns.</li>
</ul>
</li>
<li><strong>Varactor:</strong> <strong>BB910</strong> (C475628) is a low-voltage part: 35 to 45 pF at 0.5 V and 10 to 20 pF at 5 V, capacitance ratio 3.25 typical and 1.2 minimum (Shikues datasheet p.1). A low-ratio part narrows the VCO ranges, which <code>cal</code> reports.</li>
<li><strong>RF inductors:</strong> L304-L307 are Murata <strong>LQW18</strong> wire-wound parts (Q ≈ 35 at 100 MHz). The medium-wave inductors are 1210 wire-wound: NLV32T-2R2J-PF and YSCM322522-8R2J (Q = 30).</li>
<li><strong>Capacitors:</strong> every capacitor that sets a frequency, bandwidth or filter corner is C0G/NP0.</li>
<li><strong>LEDs:</strong> the green and blue LEDs (KT-0603G/B, about 2.8 V forward drop) use 220 Ω resistors so they light from a 3.3 V GPIO.</li>
</ul>
</details>
<details class="fold" open><summary><h2 id="regenerating-the-generators-are-in-tools">Regenerating (the generators are in <code>tools/</code>)<svg class="chev" viewBox="0 0 24 24" aria-hidden="true"><path d="M8 10l4 4 4-4" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg></h2></summary>
<p>Everything is generated from <code>tools/design.py</code>, the single netlist source of truth:</p>
<pre><code>cd tools
python3 make_lib.py # project symbols/footprints (ceramic filters, Adom machine pin/contact)
python3 gen_sch.py # hierarchical schematic (9 sheets incl. Molecule_IO)
python3 check_sch.py # KiCad netlist == design.py, pin for pin
python3 gen_pcb.py place # board, stackup, rules, placement, planes, Specctra DSN
# route build/amfm_receiver.dsn with Freerouting -> build/amfm_receiver.ses
python3 gen_pcb.py finish
python3 gen_pcb.py repair # DRC-driven rip-up/re-route until kicad-cli DRC is clean
python3 make_bom.py # grouped BOM with JLC type / stock / price
python3 make_jlc.py # JLCPCB BOM + CPL
./make_fab.sh # Gerbers, drill, placement, schematic PDF, BOMs
</code></pre>
</details>
<details class="fold" open><summary><h2 id="files">Files<svg class="chev" viewBox="0 0 24 24" aria-hidden="true"><path d="M8 10l4 4 4-4" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg></h2></summary>
<div class="scroll-x"><table>
<thead>
<tr>
<th>Path</th>
<th>What it is</th>
</tr>
</thead>
<tbody><tr>
<td><code>kicad/</code></td>
<td>The KiCad 10 project: <code>amfm_receiver.kicad_pro</code>, the 10 schematic sheets, <code>amfm_receiver.kicad_pcb</code>, and the project libraries in <code>kicad/lib/</code>. The five LCSC 3D models are the logo-free STEPs from the part pages (3D only; copper and fab output are unchanged).</td>
</tr>
<tr>
<td><code>fab/</code></td>
<td>What goes to JLCPCB: <code>amfm_receiver_gerbers.zip</code>, <code>amfm_receiver_BOM_JLCPCB.csv</code>, <code>amfm_receiver_CPL_JLCPCB.csv</code>, plus the full BOM, the KiCad placement file and the schematic PDF.</td>
</tr>
<tr>
<td><code>amfm-receiver-molecule.glb</code></td>
<td>The assembled board, Z-up in metres, anchored on the front-left machine pin (step2glb molecule mode), with <code>_footprint.json</code> / <code>_symbol.json</code> for placing the molecule in a layout.</td>
</tr>
<tr>
<td><code>tools/</code></td>
<td>The generators: <code>design.py</code> is the single netlist source; the others build the schematic, board, routing repairs, BOM and fab files (see Regenerating).</td>
</tr>
<tr>
<td><code>docs/screens/</code></td>
<td>The gallery and field images on this page; <code>docs/parts/</code> holds the parts-table thumbnails, each rendered from the exact model the part has on the board.</td>
</tr>
<tr>
<td><code>docs/fields/</code></td>
<td>The Adom Fields spec (<code>spec.json</code>) and its result summary (<code>fields.json</code>).</td>
</tr>
<tr>
<td>Release <code>amfm-receiver-molecule.step.gz</code></td>
<td>The full board STEP (50 MB unzipped) on the Releases tab.</td>
</tr>
<tr>
<td><code>readme.html</code></td>
<td>What the page shows: README.md as HTML with the circuit explorer in it (block diagram, netlist-checked schematics, the spectrum and waveform at every stage, the math), self-contained. Built by <code>wiki_pages/readme_html.py</code> from README.md and <code>wiki_pages/explorer</code> in the project.</td>
</tr>
</tbody></table></div>
</details>
</main>
<script>
/*!
* <adom-verified> - the component "verified by" trust mark and verification log.
*
* Drop-in (wiki README):
* ::adom-verified{src="/OWNER/SLUG/render/verification.json"}
*
* Data contract (adom/verification@1), committed in the component page's repo:
* {
* "schema": "adom/verification@1",
* "part": "WS2812B-2020",
* "variants": [ { "mpn": "WS2812B-2020-V6", "note": "12 mA", "stocked": false } ],
* "entries": [ {
* "date": "2026-10-04", "by": { "name": "John Lauer", "handle": "john" },
* "status": "verified" | "open" | "superseded",
* "title": "Footprint matches Worldsemi's PCB Solder Pad drawing",
* "scope": ["footprint", "3d-model", "hero", "specs", "stock"],
* "variants": ["*"], // "*" = every variant on the page
* "checks": [ { "text": "0.7 x 0.7 mm pads, 0.40 mm gap", "result": "pass" | "fail" | "note" } ],
* "evidence": [ { "label": "pad proof", "href": "docs/img/ws2812-pad-proof.png" } ],
* "files": { "WS2812B-2020.kicad_mod": "<sha256 hex>" } // what was verified, byte for byte
* } ]
* }
* Relative evidence hrefs and file paths resolve against the manifest's own URL (the page's
* render route). Each entry's files are fetched and hashed in the browser: if any differs,
* the entry and the badge turn amber ("changed since verified").
* Self-contained (Shadow DOM), Adom Studio brand tokens (adom-theme), matching the wiki's dark theme.
*/
(() => {
const esc = s => String(s == null ? '' : s).replace(/[&<>"]/g, c => ({ '&': '&', '<': '<', '>': '>', '"': '"' }[c]));
const MONTHS = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
const fmtDate = d => { const m = /^(\d{4})-(\d\d)-(\d\d)/.exec(d || ''); return m ? `${+m[3]} ${MONTHS[+m[2] - 1]} ${m[1]}` : esc(d); };
const SCOPE = { footprint: 'Footprint', '3d-model': '3D model', hero: 'Hero', specs: 'Specs', stock: 'Stock', symbol: 'Symbol', pinout: 'Pinout', datasheet: 'Datasheet' };
async function sha256(buf) {
const h = await crypto.subtle.digest('SHA-256', buf);
return [...new Uint8Array(h)].map(b => b.toString(16).padStart(2, '0')).join('');
}
class AdomVerified extends HTMLElement {
async connectedCallback() {
if (this._init) return; this._init = true;
this.attachShadow({ mode: 'open' });
const src = this.getAttribute('src');
this._paint('<div class="empty">loading verification log…</div>');
if (!src) return this._paint('<div class="empty">no src: point me at a verification.json</div>');
this._base = new URL(src.slice(0, src.lastIndexOf('/') + 1), location.href).href;
try { this._d = await (await fetch(src)).json(); }
catch (e) { return this._paint('<div class="empty">could not load ' + esc(src) + '</div>'); }
this._fileState = {}; // path -> 'ok' | 'changed' | 'missing' | 'checking'
this._render();
this._checkFiles();
}
_abs(href) { try { return new URL(href, this._base).href; } catch (_) { return href; } }
async _checkFiles() {
const want = {};
for (const e of this._d.entries || []) for (const [p, h] of Object.entries(e.files || {})) (want[p] = want[p] || new Set()).add(h);
const paths = Object.keys(want);
for (const p of paths) this._fileState[p] = { state: 'checking' };
this._render();
await Promise.all(paths.map(async p => {
// /render/ refuses large files (413 "File too large to render", e.g. a 7 MB STEP); the page's files API
// serves the same bytes, so fall back to it. Not fetchable at all is "unchecked", never "changed".
const urls = [this._abs(p)], m = this._base.match(/^(https?:\/\/[^/]+)\/([^/]+)\/([^/]+)\/render\//);
if (m) urls.push(`${m[1]}/api/pages/${m[2]}/${m[3]}/files/${p.split('/').map(encodeURIComponent).join('/')}`);
let status = 0;
for (const u of urls) {
try {
const r = await fetch(u);
if (r.status === 404) { status = status || 404; continue; }
if (!r.ok) { status = r.status; continue; }
this._fileState[p] = { state: 'hashed', sha: await sha256(await r.arrayBuffer()) }; return;
} catch (_) { status = status || -1; }
}
this._fileState[p] = { state: status === 404 ? 'missing' : 'unreachable' };
}));
this._render();
}
_entryState(e) {
const files = Object.entries(e.files || {});
if (!files.length) return 'unpinned';
let checking = false, unchecked = false;
for (const [p, h] of files) {
const f = this._fileState[p];
if (!f || f.state === 'checking') { checking = true; continue; }
if (f.state === 'unreachable') { unchecked = true; continue; }
if (f.state === 'missing' || f.sha !== h) return 'changed';
}
return checking ? 'checking' : unchecked ? 'unchecked' : 'current';
}
_render() {
const d = this._d, entries = [...(d.entries || [])].sort((a, b) => String(b.date).localeCompare(String(a.date)));
const verified = entries.filter(e => e.status === 'verified');
const open = entries.filter(e => e.status === 'open');
const latest = verified[0];
const states = verified.map(e => this._entryState(e));
const stale = states.includes('changed');
const checking = states.includes('checking');
const people = [...new Map(verified.map(e => [e.by && (e.by.handle || e.by.name), e.by])).values()].filter(Boolean);
const scopes = [...new Set(verified.flatMap(e => e.scope || []))];
const tone = !latest ? 'none' : stale ? 'stale' : 'ok';
const icon = tone === 'ok'
? '<svg viewBox="0 0 48 48" aria-hidden="true"><circle cx="24" cy="24" r="22"/><path d="M14 25l7 7 13-15" fill="none" stroke-width="5" stroke-linecap="round" stroke-linejoin="round"/></svg>'
: '<svg viewBox="0 0 48 48" aria-hidden="true"><circle cx="24" cy="24" r="22"/><path d="M24 13v14M24 34v1" fill="none" stroke-width="5" stroke-linecap="round"/></svg>';
const headline = !latest ? 'Not verified yet' : stale ? 'Verified, but files changed since' : 'Verified';
const sub = latest
? `by ${people.map(p => esc(p.name)).join(', ')} · last ${fmtDate(latest.date)} · ${verified.length} record${verified.length === 1 ? '' : 's'}${checking ? ' · checking files…' : stale ? '' : states.includes('unchecked') ? ' · some files could not be fetched to check' : ' · files match'}`
: 'no verification records on this page';
const scopeChips = scopes.map(s => `<span class="chip">${esc(SCOPE[s] || s)}</span>`).join('');
const vs = d.variants || [];
const covered = mpn => verified.filter(e => (e.variants || ['*']).some(v => v === '*' || v === mpn));
const varRows = vs.length ? `<div class="vars">${vs.map(v => {
const c = covered(v.mpn), sc = new Set(c.flatMap(e => e.scope || []));
return `<div class="var${v.stocked ? ' stocked' : ''}"><div class="vm">${esc(v.mpn)}${v.stocked ? '<span class="tag">Adom Basic Part</span>' : ''}</div>
<div class="vn">${esc(v.note || '')}</div>
<div class="vs">${sc.size ? [...sc].map(s => `<span class="mini ok">${esc(SCOPE[s] || s)}</span>`).join('') : '<span class="mini none">not verified</span>'}</div></div>`;
}).join('')}</div>` : '';
const log = entries.map(e => {
const st = e.status === 'verified' ? this._entryState(e) : e.status;
const badge = e.status === 'open' ? '<span class="pill open">open</span>'
: e.status === 'superseded' ? '<span class="pill sup">superseded</span>'
: st === 'changed' ? '<span class="pill stale">changed since</span>'
: st === 'checking' ? '<span class="pill">checking</span>'
: st === 'current' ? '<span class="pill ok">files match</span>' : '<span class="pill ok">verified</span>';
const checks = (e.checks || []).map(c => `<li class="${esc(c.result || 'pass')}"><span class="mk">${c.result === 'fail' ? '✕' : c.result === 'note' ? '•' : '✓'}</span>${esc(c.text)}</li>`).join('');
const ev = (e.evidence || []).map(x => `<a href="${esc(this._abs(x.href))}" target="_blank" rel="noopener">${esc(x.label)}</a>`).join('');
const files = Object.entries(e.files || {}).map(([p, h]) => {
const f = this._fileState[p] || {}, ok = f.state === 'hashed' && f.sha === h;
const un = f.state === 'unreachable';
return `<span class="file ${ok ? 'ok' : f.state === 'checking' || un ? '' : 'bad'}" title="${un ? 'could not be fetched to check; ' : ''}sha256 ${esc(h)}">${ok ? '✓' : f.state === 'checking' ? '…' : un ? '?' : '!'} ${esc(p)}</span>`;
}).join('');
const vars = (e.variants || ['*']).map(v => v === '*' ? 'all variants' : v).join(', ');
return `<details class="entry ${esc(e.status)}"><summary>
<span class="date">${fmtDate(e.date)}</span><span class="who">${esc(e.by && e.by.name)}</span>
<span class="title">${esc(e.title)}</span>${badge}</summary>
<div class="body"><div class="meta">${(e.scope || []).map(s => `<span class="chip">${esc(SCOPE[s] || s)}</span>`).join('')}<span class="for">for ${esc(vars)}</span></div>
${checks ? `<ul class="checks">${checks}</ul>` : ''}
${ev ? `<div class="ev"><span class="lbl">Evidence</span>${ev}</div>` : ''}
${files ? `<div class="files"><span class="lbl">Verified files</span>${files}</div>` : ''}</div></details>`;
}).join('');
this._paint(`<div class="badge ${tone}"><div class="icon">${icon}</div><div class="hb">
<div class="h">${headline}${d.part ? ` <span class="part">${esc(d.part)}</span>` : ''}</div>
<div class="sub">${sub}</div><div class="scopes">${scopeChips}${open.length ? `<span class="chip warn">${open.length} open item${open.length === 1 ? '' : 's'}</span>` : ''}</div></div></div>
${varRows}
<details class="logwrap"${this._logOpen ? ' open' : ''}><summary class="logh">Verification log <span class="logn">${entries.length} record${entries.length === 1 ? '' : 's'}${open.length ? ` · ${open.length} open` : ''}</span></summary>
<div class="log">${log || '<div class="empty">no entries</div>'}</div></details>`);
const lw = this.shadowRoot.querySelector('details.logwrap'); // collapsed by default; keep the reader's choice across re-renders
if (lw) lw.addEventListener('toggle', () => { this._logOpen = lw.open; });
}
_paint(inner) { this.shadowRoot.innerHTML = `<style>${this._css()}</style><div class="card">${inner}</div>`; }
_css() {
return `
:host{display:block;--bg:#161b22;--panel:#0d1117;--line:#30363d;--text:#e6edf3;--body:#c9d1d9;--dim:#8b949e;--ok:#3fb950;--okbg:rgba(63,185,80,.10);--warn:#d29922;--warnbg:rgba(210,153,34,.10);--bad:#f85149;--accent:#00b8b1;--accent-bright:#00e6dc;--prose:var(--font-body,Satoshi,-apple-system,'Segoe UI',sans-serif);--display:var(--font-display,'Familjen Grotesk',Satoshi,sans-serif);--mono:var(--font-mono,'JetBrains Mono',Consolas,ui-monospace,monospace)}
*{box-sizing:border-box}
.card{background:var(--bg);border:1px solid var(--line);border-radius:14px;padding:16px;color:var(--text);font:14px/1.5 var(--prose)}
.empty{color:var(--dim);padding:8px}
.badge{display:flex;gap:16px;align-items:center;padding:14px;border-radius:12px;border:1px solid var(--line);background:var(--panel)}
.badge.ok{background:var(--okbg);border-color:color-mix(in srgb,var(--ok) 45%,transparent)}
.badge.stale{background:var(--warnbg);border-color:color-mix(in srgb,var(--warn) 45%,transparent)}
.icon svg{width:56px;height:56px;display:block}
.badge.ok .icon circle{fill:var(--ok)} .badge.ok .icon path{stroke:#fff}
.badge.stale .icon circle,.badge.none .icon circle{fill:var(--warn)} .badge.stale .icon path,.badge.none .icon path{stroke:#fff}
.h{font:700 21px/1.2 var(--display);letter-spacing:-.01em}.part{font-weight:500;color:var(--dim);font-size:14px;margin-left:6px}
.sub{color:var(--dim);margin:2px 0 8px}
.scopes,.meta{display:flex;flex-wrap:wrap;gap:6px;align-items:center}
.chip{font-size:12px;padding:2px 8px;border-radius:999px;border:1px solid var(--line);background:var(--bg)}
.chip.warn{border-color:var(--warn);color:var(--warn)}
.vars{display:grid;grid-template-columns:repeat(auto-fill,minmax(190px,1fr));gap:8px;margin:14px 0}
.var{border:1px solid var(--line);border-radius:10px;padding:9px 10px;background:var(--panel)}
.var.stocked{border-color:var(--ok)}
.vm{font-weight:600;display:flex;gap:6px;align-items:center;flex-wrap:wrap}
.tag{font-size:11px;font-weight:600;color:#0d1117;background:var(--ok);border-radius:6px;padding:1px 6px}
.vn{color:var(--dim);font-size:12px;margin:2px 0 6px}
.vs{display:flex;flex-wrap:wrap;gap:4px}
.mini{font-size:11px;padding:1px 6px;border-radius:6px}.mini.ok{background:var(--okbg);color:var(--ok)}.mini.none{background:var(--warnbg);color:var(--warn)}
.logh{font:700 16px/1.2 var(--display);margin:16px 0 6px;cursor:pointer}.logn{font:500 13px var(--prose);color:var(--dim);margin-left:6px}details.logwrap>summary{list-style:none;display:flex;align-items:baseline;gap:6px}details.logwrap>summary::-webkit-details-marker{display:none}details.logwrap>summary::before{content:'\\25B8';color:var(--accent);font-size:14px;transition:transform .15s;display:inline-block}details.logwrap[open]>summary::before{transform:rotate(90deg)}
.entry{border:1px solid var(--line);border-radius:10px;background:var(--panel);margin:6px 0}
.entry.open{border-color:color-mix(in srgb,var(--warn) 55%,transparent)}
summary{cursor:pointer;list-style:none;display:flex;gap:10px;align-items:center;padding:9px 12px;flex-wrap:wrap}
summary::-webkit-details-marker{display:none}
.date{font-family:var(--mono);font-size:12px;color:var(--dim);min-width:86px}.who{font-weight:600}.title{flex:1;min-width:200px}
.pill{font-size:11px;padding:2px 8px;border-radius:999px;border:1px solid var(--line);color:var(--dim)}
.pill.ok{color:var(--ok);border-color:var(--ok)}.pill.open,.pill.stale{color:var(--warn);border-color:var(--warn)}
.body{padding:0 12px 12px}
.for{font-size:12px;color:var(--dim)}
.checks{margin:8px 0;padding:0;list-style:none}.checks li{display:flex;gap:8px;padding:2px 0}
.mk{color:var(--ok);font-weight:700;width:14px;flex:none}.checks li.fail .mk{color:var(--bad)}.checks li.note .mk{color:var(--dim)}
.ev,.files{display:flex;flex-wrap:wrap;gap:6px 12px;align-items:center;margin-top:6px;font-size:13px}
.lbl{color:var(--dim);font-size:12px}
a{color:var(--accent)}a:hover{color:var(--accent-bright)}
.file{font-family:var(--mono);font-size:12px}.file.ok{color:var(--ok)}.file.bad{color:var(--warn)}`;
}
}
if (!customElements.get('adom-verified')) customElements.define('adom-verified', AdomVerified);
})();
</script>
<script>
/* AM/FM Receiver Explorer, the wiki widget <adom-amfm-explorer>. Generated by widget.py from
amfm_receiver/wiki_pages/explorer (the same sources as the artifact); edit those, not this file. */
(function () {
if (!window.customElements || customElements.get('adom-amfm-explorer')) return;
var CSS = "/* Schematic styling. Colors come from tokens the page defines; the defaults keep previews readable. */\nsvg.sch { --ink: #1d2a3a; --ink2: #5b6b80; --wire: #2f4a6b; --spaper: #fbfcfd; --grid: rgba(40, 80, 120, .06);\n --val: #0c6f6b; --flag: #6c4fd6; --flagbg: rgba(108, 79, 214, .08); --tp: #0b8f88; --hl: #e0750b; --region: rgba(47, 74, 107, .35);\n overflow: visible; font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }\nsvg.sch .sym path, svg.sch .sym .body { fill: none; stroke: var(--ink); stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }\nsvg.sch .sym path.fill, svg.sch .sym .dot { fill: var(--ink); stroke: none; }\nsvg.sch .part.tp .sym circle { stroke: var(--tp); fill: var(--spaper); }\nsvg.sch .part.tp .sym path, svg.sch .part.mc .sym path { stroke: var(--tp); }\nsvg.sch .part.mc .sym path.fill { fill: var(--tp); }\nsvg.sch .wire { fill: none; stroke: var(--wire); stroke-width: 1.4; stroke-linejoin: round; stroke-linecap: round; }\nsvg.sch .junction { fill: var(--wire); }\nsvg.sch .gnd, svg.sch .rail path { fill: none; stroke: var(--ink2); stroke-width: 1.4; stroke-linecap: round; }\nsvg.sch text { font-size: 9px; fill: var(--ink2); }\nsvg.sch .ref { fill: var(--ink2); font-size: 8.5px; }\nsvg.sch .val { fill: var(--val); font-size: 9px; font-weight: 600; }\nsvg.sch .pinname { font-size: 7.5px; fill: var(--ink2); }\nsvg.sch .inner { font-size: 7.5px; fill: var(--ink); font-weight: 600; }\nsvg.sch .tpl { fill: var(--tp); font-size: 8.5px; font-weight: 700; }\nsvg.sch .rail text { fill: var(--ink); font-size: 8.5px; font-weight: 600; }\nsvg.sch .flag path { fill: var(--flagbg); stroke: var(--flag); stroke-width: 1.2; }\nsvg.sch .flag text { fill: var(--flag); font-size: 8.5px; font-weight: 600; }\nsvg.sch .note { fill: var(--ink2); font-size: 8.5px; font-style: italic; font-family: inherit; }\nsvg.sch .region { fill: none; stroke: var(--region); stroke-width: 1; stroke-dasharray: 4 3; }\nsvg.sch .region-t { fill: var(--ink2); font-size: 8.5px; font-weight: 600; letter-spacing: .02em; }\nsvg.sch .hit { fill: transparent; stroke: none; }\nsvg.sch .wire-hit { fill: none; stroke: transparent; stroke-width: 9; pointer-events: stroke; cursor: crosshair; }\n/* interaction */\nsvg.sch .part, svg.sch .flag { cursor: pointer; }\nsvg.sch .wire, svg.sch .junction { cursor: crosshair; }\nsvg.sch .hl.wire, svg.sch .hl.gnd, svg.sch .rail.hl path { stroke: var(--hl); stroke-width: 2.4; }\nsvg.sch .hl.junction { fill: var(--hl); }\nsvg.sch .flag.hl path { stroke: var(--hl); stroke-width: 2; }\nsvg.sch .part.hot .sym path, svg.sch .part.hot .sym .body { stroke: var(--hl); }\nsvg.sch .part.hot .sym path.fill { fill: var(--hl); }\nsvg.sch .part.hot .ref { fill: var(--hl); }\nsvg.sch .part.dim { opacity: .28; }\n\n/* Layout: a header strip, a station tuner, the full-width signal flowchart, then a two-column\n detail view (schematic | explanation) for the selected block. Adom palette: teal = FM, purple = AM. */\n:host {\n --bg: #f3f6f8; --surface: #ffffff; --surface-2: #eaf0f4; --line: #d3dde5; --line-2: #b9c7d3;\n --text: #0e1b2b; --text-2: #46586c; --text-3: #758597;\n --accent: #00837d; --accent-fill: #00b8b1; --on-accent: #ffffff;\n --fm: #00968f; --fm-soft: rgba(0, 150, 143, .11);\n --am: #7552e6; --am-soft: rgba(117, 82, 230, .10);\n --if: #2d6cd0; --if-soft: rgba(45, 108, 208, .09);\n --ctrl: #a86b10; --ctrl-soft: rgba(168, 107, 16, .10);\n --dig: #52657a; --dig-soft: rgba(82, 101, 122, .10);\n --warn: #b4460c; --warn-soft: rgba(212, 98, 26, .08); --warn-line: rgba(180, 70, 12, .35);\n --hl: #e0750b;\n --sig-fm: #00968f; --sig-am: #7552e6; --sig-img: #b5179e; --sig-sub: #a86b10; --sig-other: #8b98a7;\n --paper: #fbfcfd; --grid: rgba(40, 80, 120, .055);\n --s-ink: #1d2a3a; --s-ink2: #5b6b80; --s-wire: #2f4a6b; --s-val: #0a6c67; --s-flag: #6142d4; --s-flagbg: rgba(97, 66, 212, .07); --s-tp: #008a83; --s-region: rgba(47, 74, 107, .32);\n --f-display: 'Familjen Grotesk', 'Figtree', system-ui, sans-serif;\n --f-body: 'Figtree', system-ui, -apple-system, 'Segoe UI', sans-serif;\n --f-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;\n --r: 8px;\n}\n\n\n\n* { box-sizing: border-box; }\n.app { background: var(--bg); color: var(--text); font: 15px/1.55 var(--f-body); margin: 0; }\n.wrap { max-width: 1240px; margin: 0 auto; grid-template-columns: minmax(0, 1fr); padding-block: 28px 64px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); display: grid; gap: 22px; }\nh1, h2, h3 { font-family: var(--f-display); text-wrap: balance; margin: 0; letter-spacing: -.01em; }\ncode, .mono { font-family: var(--f-mono); font-size: .86em; }\ncode { background: var(--surface-2); padding: .05em .35em; border-radius: 4px; white-space: nowrap; }\na { color: var(--accent); }\nbutton { font: inherit; color: inherit; }\n:focus-visible { outline: 2px solid var(--accent-fill); outline-offset: 2px; }\n\n/* header */\n.top { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 24px; align-items: end; }\n.eyebrow { font: 600 11.5px/1 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }\n.top h1 { font-size: clamp(28px, 4.2vw, 42px); line-height: 1.05; font-weight: 700; margin-top: 8px; }\n.top h1 .fm { color: var(--fm); } .top h1 .am { color: var(--am); }\n.lede { color: var(--text-2); max-width: 68ch; margin: 10px 0 0; }\n.toplinks { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; font-size: 13.5px; }\n.check { font: 500 12px var(--f-mono); color: var(--text-3); }\n.check b { color: var(--fm); font-weight: 600; }\n\n/* panels */\n.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }\n.panel-h { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 12px 16px; border-bottom: 1px solid var(--line); }\n.panel-h h2 { font-size: 16px; font-weight: 650; }\n.hint { color: var(--text-3); font-size: 13px; }\n\n/* tuner */\n.tuner { display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); }\n.tuner-ctl { padding: 16px; display: grid; gap: 14px; align-content: start; border-right: 1px solid var(--line); }\n.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 7px; overflow: hidden; }\n.seg button { border: 0; background: transparent; padding: 6px 13px; font-size: 13.5px; font-weight: 600; cursor: pointer; color: var(--text-2); }\n.seg button + button { border-left: 1px solid var(--line-2); }\n.seg button[aria-pressed=\"true\"] { background: var(--text); color: var(--bg); }\n.seg.band button[data-band=\"fm\"][aria-pressed=\"true\"] { background: var(--fm); color: #fff; }\n.seg.band button[data-band=\"am\"][aria-pressed=\"true\"] { background: var(--am); color: #fff; }\n.ctl-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }\n.ctl-label { font: 600 11px var(--f-mono); letter-spacing: .07em; text-transform: uppercase; color: var(--text-3); }\n.station { display: grid; gap: 6px; }\n.station-read { display: flex; align-items: baseline; gap: 8px; }\n.station-read input { font: 700 30px var(--f-display); width: 5.2ch; border: 0; border-bottom: 2px solid var(--line-2); background: transparent; color: var(--text); padding: 0; font-variant-numeric: tabular-nums; }\n.station-read span { font: 600 15px var(--f-display); color: var(--text-2); }\ninput[type=range] { width: 100%; accent-color: var(--accent-fill); }\n.presets { display: flex; flex-wrap: wrap; gap: 6px; }\n.presets button { border: 1px solid var(--line-2); background: var(--surface); border-radius: 999px; padding: 2px 9px; font: 500 12px var(--f-mono); cursor: pointer; color: var(--text-2); }\n.presets button:hover { border-color: var(--accent-fill); color: var(--text); }\n.tuner-out { padding: 14px 16px 12px; display: grid; gap: 10px; min-width: 0; }\n.freqs { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 8px; }\n.freq { border: 1px solid var(--line); border-radius: 7px; padding: 7px 10px; background: var(--surface-2); min-width: 0; }\n.freq .k { font: 600 10.5px var(--f-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }\n.freq .v { font: 600 16px var(--f-mono); font-variant-numeric: tabular-nums; white-space: nowrap; }\n.freq.rf .k::before, .freq.lo .k::before, .freq.img .k::before { content: ''; display: inline-block; width: 12px; height: 2px; margin-right: 6px; vertical-align: middle; background: var(--sig-fm); }\n.band-am .freq.rf .k::before { background: var(--sig-am); } .freq.lo .k::before { background: var(--text-2); } .freq.img .k::before { background: var(--sig-img); }\n.verdict { font-size: 13.5px; color: var(--text-2); min-height: 2.6em; }\n.verdict b { color: var(--text); }\n.verdict.bad b { color: var(--warn); }\n.spec-wrap { overflow-x: auto; }\nsvg.spec { width: 100%; min-width: 520px; height: auto; display: block; }\nsvg.spec text { font: 500 10px var(--f-mono); fill: var(--text-3); }\nsvg.spec .axis { stroke: var(--line-2); stroke-width: 1; }\nsvg.spec .tick { stroke: var(--line-2); }\nsvg.spec .bandfill { fill: var(--fm-soft); } .band-am svg.spec .bandfill { fill: var(--am-soft); }\nsvg.spec .airfill { fill: var(--dig-soft); }\nsvg.spec .resp { fill: var(--fm-soft); stroke: var(--fm); stroke-width: 1.4; } .band-am svg.spec .resp { fill: var(--am-soft); stroke: var(--am); }\nsvg.spec .m-rf { stroke: var(--sig-fm); stroke-width: 2; } .band-am svg.spec .m-rf { stroke: var(--sig-am); }\nsvg.spec .m-lo { stroke: var(--text-2); stroke-width: 2; }\nsvg.spec .m-img { stroke: var(--sig-img); stroke-width: 2; stroke-dasharray: 4 3; }\nsvg.spec .lorange { fill: var(--if-soft); stroke: var(--if); stroke-width: 1; }\nsvg.spec .lbl-rf, svg.spec .lbl-lo, svg.spec .lbl-img { fill: var(--text); font-weight: 700; }\n\n/* flowchart */\n.flow-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--text-2); }\n.flow-legend i { display: inline-block; width: 18px; height: 3px; border-radius: 2px; vertical-align: middle; margin-right: 6px; }\n.flow-legend .ctrl i { background: repeating-linear-gradient(90deg, var(--ctrl) 0 4px, transparent 4px 7px); }\n.flow-scroll { overflow-x: auto; padding: 8px 8px 4px; }\nsvg.flow { display: block; width: 100%; min-width: 860px; height: auto; font-family: var(--f-body); }\nsvg.flow .sec { font: 700 11px var(--f-mono); letter-spacing: .08em; text-transform: uppercase; fill: var(--text-3); }\nsvg.flow .divider { stroke: var(--line); stroke-dasharray: 2 4; }\nsvg.flow .edge { fill: none; stroke-width: 2; stroke-linejoin: round; }\nsvg.flow .edge.fm { stroke: var(--fm); } svg.flow .edge.am { stroke: var(--am); } svg.flow .edge.if { stroke: var(--if); } svg.flow .edge.dig { stroke: var(--dig); }\nsvg.flow .edge.ctrl { stroke: var(--ctrl); stroke-width: 1.5; stroke-dasharray: 5 4; }\nsvg.flow .pulse { fill: none; stroke-width: 2.6; stroke-dasharray: 3 21; stroke-linecap: round; animation: run 1.1s linear infinite; opacity: 0; }\nsvg.flow .pulse.fm { stroke: var(--fm); } svg.flow .pulse.am { stroke: var(--am); } svg.flow .pulse.if { stroke: var(--if); } svg.flow .pulse.dig { stroke: var(--dig); }\nsvg.flow .live .pulse { opacity: .95; }\n@keyframes run { to { stroke-dashoffset: -24; } }\n@media (prefers-reduced-motion: reduce) { svg.flow .pulse { animation: none; } }\nsvg.flow .elabel { font: 500 9.5px var(--f-mono); fill: var(--text-2); paint-order: stroke; stroke: var(--surface); stroke-width: 4px; stroke-linejoin: round; }\nsvg.flow .elabel.dyn { font-weight: 700; fill: var(--text); }\nsvg.flow .egroup.off { opacity: .16; }\nsvg.flow .node { cursor: pointer; }\nsvg.flow .node rect.box { fill: var(--surface); stroke-width: 1.4; }\nsvg.flow .node.fm rect.box { stroke: var(--fm); } svg.flow .node.am rect.box { stroke: var(--am); } svg.flow .node.if rect.box { stroke: var(--if); }\nsvg.flow .node.ctrl rect.box { stroke: var(--ctrl); } svg.flow .node.dig rect.box { stroke: var(--dig); }\nsvg.flow .node.term rect.box { stroke: var(--line-2); stroke-dasharray: 3 3; fill: transparent; }\nsvg.flow .node .t { font: 650 12px var(--f-display); fill: var(--text); }\nsvg.flow .node .s { font: 500 9.5px var(--f-mono); fill: var(--text-2); }\nsvg.flow .node .pin { font: 500 9px var(--f-mono); fill: var(--text-3); }\nsvg.flow .node .pin tspan.p { fill: var(--text-2); font-weight: 600; }\nsvg.flow .node .dot { stroke: none; }\nsvg.flow .node.fm .dot { fill: var(--fm); } svg.flow .node.am .dot { fill: var(--am); } svg.flow .node.if .dot { fill: var(--if); } svg.flow .node.ctrl .dot { fill: var(--ctrl); } svg.flow .node.dig .dot { fill: var(--dig); }\nsvg.flow .node .warn { fill: var(--warn); }\nsvg.flow .node:hover rect.box, svg.flow .node.rel rect.box { stroke-width: 2.4; }\nsvg.flow .node.sel rect.box { stroke-width: 2.6; }\nsvg.flow .node.sel.fm rect.box { fill: var(--fm-soft); } svg.flow .node.sel.am rect.box { fill: var(--am-soft); } svg.flow .node.sel.if rect.box { fill: var(--if-soft); }\nsvg.flow .node.sel.ctrl rect.box { fill: var(--ctrl-soft); } svg.flow .node.sel.dig rect.box { fill: var(--dig-soft); }\nsvg.flow .node.off { opacity: .32; }\nsvg.flow .node:focus-visible { outline: none; } svg.flow .node:focus-visible rect.box { stroke-width: 3; }\n\n/* detail */\n.detail { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, 1fr); }\n.detail-h { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 16px; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); }\n.detail-h h2 { font-size: 22px; font-weight: 700; }\n.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 4px; }\n.chip { font: 600 11px var(--f-mono); letter-spacing: .04em; padding: 2px 8px; border-radius: 999px; border: 1px solid; }\n.chip.fm { color: var(--fm); border-color: var(--fm); background: var(--fm-soft); }\n.chip.am { color: var(--am); border-color: var(--am); background: var(--am-soft); }\n.chip.if { color: var(--if); border-color: var(--if); background: var(--if-soft); }\n.chip.ctrl { color: var(--ctrl); border-color: var(--ctrl); background: var(--ctrl-soft); }\n.chip.dig { color: var(--dig); border-color: var(--dig); background: var(--dig-soft); }\n.chip.src { color: var(--text-3); border-color: var(--line-2); background: transparent; }\n.nav { display: flex; gap: 6px; }\n.nav button, .zoom button { border: 1px solid var(--line-2); background: var(--surface); border-radius: 7px; padding: 5px 11px; font-size: 13px; font-weight: 600; cursor: pointer; }\n.nav button:hover, .zoom button:hover { border-color: var(--accent-fill); }\n.nav button:disabled { opacity: .4; cursor: default; }\n.sch-col { min-width: 0; display: grid; grid-template-rows: auto auto auto auto; align-self: start; }\n.info { border-left: 1px solid var(--line); }\n.sch-bar { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; justify-content: space-between; padding: 8px 12px; border-bottom: 1px solid var(--line); }\n.zoom { display: flex; gap: 4px; }\n.zoom button { padding: 3px 9px; font-family: var(--f-mono); }\n.find { display: flex; gap: 6px; align-items: center; }\n.find input { font: 500 13px var(--f-mono); border: 1px solid var(--line-2); border-radius: 7px; padding: 4px 8px; width: 15ch; background: var(--surface); color: var(--text); }\n.find .msg { font-size: 12px; color: var(--warn); }\n.sch-view { position: relative; overflow: hidden; background-color: var(--paper);\n background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);\n background-size: 12px 12px; min-height: 300px; touch-action: none; cursor: grab; }\n.sch-view.dragging { cursor: grabbing; }\n.sch-view svg.sch { display: block; width: 100%; height: auto; max-height: 680px; }\nsvg.sch { --ink: var(--s-ink); --ink2: var(--s-ink2); --wire: var(--s-wire); --val: var(--s-val); --flag: var(--s-flag); --flagbg: var(--s-flagbg); --tp: var(--s-tp); --region: var(--s-region); --spaper: var(--paper); }\n.sch-key { display: flex; flex-wrap: wrap; gap: 4px 14px; padding: 8px 12px; border-top: 1px solid var(--line); font-size: 12px; color: var(--text-3); }\n.sch-key b { font-family: var(--f-mono); font-weight: 700; }\n.sch-key .k-tp { color: var(--s-tp); } .sch-key .k-flag { color: var(--s-flag); } .sch-key .k-hl { color: var(--hl); }\n.info { padding: 16px; display: grid; gap: 16px; align-content: start; min-width: 0; }\n.role { font: 600 16px/1.4 var(--f-display); }\n.info p { margin: 0; color: var(--text-2); }\n.info .text { display: grid; gap: 10px; }\n.info h3 { font: 700 11px var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); margin-bottom: 6px; }\n.facts { margin: 0; padding: 0; list-style: none; display: grid; gap: 5px; }\n.facts li { font-size: 13.5px; color: var(--text-2); padding-left: 14px; position: relative; }\n.facts li::before { content: ''; position: absolute; left: 2px; top: .62em; width: 5px; height: 5px; border-radius: 50%; background: var(--line-2); }\n.board { border: 1px solid var(--warn-line); background: var(--warn-soft); border-radius: 7px; padding: 10px 12px; }\n.board h3 { color: var(--warn); }\n.board p { color: var(--text); font-size: 14px; }\n.parts { width: 100%; border-collapse: collapse; font-size: 12.5px; }\n.parts td { padding: 3px 6px 3px 0; border-bottom: 1px solid var(--line); vertical-align: top; }\n.parts td:first-child { font-family: var(--f-mono); font-weight: 600; white-space: nowrap; }\n.parts td:nth-child(2) { font-family: var(--f-mono); color: var(--s-val); white-space: nowrap; }\n.parts td:last-child { color: var(--text-3); }\n.parts tr { cursor: pointer; }\n.parts tr:hover td, .parts tr.hot td { background: var(--surface-2); }\n.parts-wrap { max-height: 300px; overflow: auto; }\n.card { border: 1px solid var(--line-2); border-radius: 7px; padding: 10px 12px; display: grid; gap: 6px; background: var(--surface-2); }\n.card .ct { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }\n.card .ct b { font: 700 16px var(--f-mono); }\n.card .ct button { border: 0; background: transparent; cursor: pointer; color: var(--text-3); font-size: 16px; line-height: 1; }\n.card .cv { font: 600 13px var(--f-mono); color: var(--s-val); }\n.card .cd { font-size: 13px; color: var(--text-2); }\n.card .cl { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 13px; }\n.card .pins { display: flex; flex-wrap: wrap; gap: 4px; }\n.card .pins button { border: 1px solid var(--line-2); background: var(--surface); border-radius: 5px; padding: 1px 6px; font: 500 11.5px var(--f-mono); cursor: pointer; color: var(--text-2); }\n.card .pins button:hover { border-color: var(--hl); color: var(--text); }\n.src { font: 500 12px var(--f-mono); color: var(--text-3); }\n\n/* tooltip & menus */\n.tip { position: fixed; z-index: 20; pointer-events: none; max-width: 300px; background: var(--text); color: var(--bg); border-radius: 6px; padding: 7px 9px; font-size: 12.5px; line-height: 1.4; box-shadow: 0 6px 18px rgba(0, 0, 0, .18); }\n.tip b { font-family: var(--f-mono); }\n.tip .tv { font-family: var(--f-mono); opacity: .85; }\n.tip .td { opacity: .8; }\n.menu { position: fixed; z-index: 21; background: var(--surface); border: 1px solid var(--line-2); border-radius: 8px; padding: 4px; display: grid; min-width: 200px; box-shadow: 0 8px 22px rgba(0, 0, 0, .18); }\n.menu .mh { font: 600 11px var(--f-mono); color: var(--text-3); padding: 5px 8px 3px; }\n.menu button { border: 0; background: transparent; text-align: left; padding: 6px 8px; border-radius: 5px; cursor: pointer; font-size: 13.5px; }\n.menu button:hover, .menu button:focus-visible { background: var(--surface-2); }\n\n@container xp (max-width: 900px) {\n .tuner { grid-template-columns: minmax(0, 1fr); }\n .tuner-ctl { border-right: 0; border-bottom: 1px solid var(--line); }\n .detail { grid-template-columns: minmax(0, 1fr); }\n .sch-col { border-bottom: 1px solid var(--line); position: static; }\n .info { border-left: 0; }\n .top { grid-template-columns: minmax(0, 1fr); }\n .toplinks { align-items: flex-start; }\n}\n@container xp (max-width: 560px) {\n .detail-h { grid-template-columns: minmax(0, 1fr); }\n .find input { width: 11ch; }\n}\n\n/* tabs */\n.tabs { display: inline-flex; gap: 2px; background: var(--surface-2); border-radius: 8px; padding: 3px; }\n.tabs button { border: 0; background: transparent; padding: 5px 12px; border-radius: 6px; font-size: 13.5px; font-weight: 600; color: var(--text-2); cursor: pointer; }\n.tabs button[aria-selected=\"true\"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, .12); }\n.view-note { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; padding: 10px 16px 0; }\n.spec-note { display: grid; gap: 8px; padding: 12px 16px 4px; }\n.spec-note p { margin: 0; color: var(--text-2); max-width: 90ch; font-size: 14px; }\n.spec-note p.hint { font-size: 12.5px; color: var(--text-3); }\n.spec-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 12.5px; color: var(--text-2); }\n.spec-legend span { display: inline-flex; align-items: center; gap: 6px; }\n.spec-legend i { display: inline-block; width: 16px; height: 0; border-top: 2px solid var(--sc); }\n.spec-legend i.dash { border-top-style: dashed; }\n.spec-legend i.fill { height: 9px; border: 0; background: var(--text-3); opacity: .3; }\n.spec-legend i.ghost { border-top: 1.5px dashed var(--text-3); opacity: .8; }\n.spec-legend i.ref { border-top: 1px dashed var(--text-2); }\n.spec-legend i.trace { height: 9px; border: 0; border-top: 1.5px solid var(--text-2); background: color-mix(in srgb, var(--text-3) 22%, transparent); }\n.spec-legend i.band { height: 9px; border: 0; background: color-mix(in srgb, var(--text) 9%, transparent); }\n.band-fm, .spec-grid.band-fm { --sig-st: var(--sig-fm); }\n.band-am, .spec-grid.band-am { --sig-st: var(--sig-am); }\n\n/* stage cards */\n.spec-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 520px), 1fr)); gap: 14px; padding: 12px 16px 16px; }\n.stage { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px 8px; display: grid; gap: 4px; align-content: start; min-width: 0; background: var(--surface); }\n.stage header { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }\n.stage .step { font: 700 12px var(--f-mono); color: var(--text-3); min-width: 1.6em; }\n.stage .sh { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; flex: 1; min-width: 0; }\n.stage h3 { font-size: 15px; font-weight: 650; }\n.stage .parts { font: 500 11.5px var(--f-mono); color: var(--text-3); }\n.stage .est { font: 600 10.5px var(--f-mono); color: var(--text-3); border: 1px solid var(--line-2); border-radius: 999px; padding: 0 7px; }\n.stage .open { border: 1px solid var(--line-2); background: var(--surface); border-radius: 6px; padding: 2px 9px; font-size: 12px; font-weight: 600; cursor: pointer; }\n.stage .open:hover { border-color: var(--accent-fill); }\n.stage .cap { margin: 0; font-size: 13px; color: var(--text-2); line-height: 1.5; }\n.stage details { font-size: 12.5px; color: var(--text-3); }\n.stage summary { cursor: pointer; width: max-content; }\n.stage table { border-collapse: collapse; margin-top: 4px; width: 100%; font-variant-numeric: tabular-nums; }\n.stage th { text-align: left; font-weight: 600; color: var(--text-3); padding: 2px 8px 2px 0; border-bottom: 1px solid var(--line); }\n.stage td { padding: 2px 8px 2px 0; border-bottom: 1px solid var(--line); color: var(--text-2); }\n.stage td.n { font-family: var(--f-mono); white-space: nowrap; text-align: right; }\n.spec-end { grid-column: 1 / -1; color: var(--text-3); font-size: 13px; padding: 4px 2px; }\nsvg.stg { display: block; width: 100%; height: auto; font-family: var(--f-mono); overflow: visible; }\nsvg.stg .grid { stroke: var(--line); stroke-width: 1; }\nsvg.stg .grid.zero { stroke: var(--line-2); }\nsvg.stg .axis { stroke: var(--line-2); stroke-width: 1; }\nsvg.stg .tk { font-size: 9.5px; fill: var(--text-3); font-variant-numeric: tabular-nums; }\nsvg.stg .pl { font: 600 10px var(--f-mono); fill: var(--text-3); }\nsvg.stg .rline { fill: none; stroke: var(--text-2); stroke-width: 2; stroke-linejoin: round; }\nsvg.stg .rarea { fill: var(--text-2); opacity: .07; }\nsvg.stg .noise { fill: var(--text-3); opacity: .16; }\nsvg.stg .ref { stroke: var(--text-3); stroke-width: 1; }\nsvg.stg .refl { font-size: 9px; fill: var(--text-3); }\nsvg.stg .k-station { --sc: var(--sig-st); } svg.stg .k-image { --sc: var(--sig-img); } svg.stg .k-sub { --sc: var(--sig-sub); } svg.stg .k-other { --sc: var(--sig-other); }\nsvg.stg .sg .line { fill: none; stroke: var(--sc); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }\nsvg.stg .sg .fillp { fill: var(--sc); opacity: .1; }\nsvg.stg .sg .cap { fill: var(--sc); stroke: var(--surface); stroke-width: 2; }\nsvg.stg .sg.k-image .line { stroke-dasharray: 5 3; }\nsvg.stg .gh .line { fill: none; stroke: var(--text-3); stroke-width: 1.2; opacity: .5; }\nsvg.stg .gh .fillp { fill: var(--text-3); opacity: .05; }\nsvg.stg .dl { font: 600 10.5px var(--f-body); fill: var(--text); paint-order: stroke; stroke: var(--surface); stroke-width: 3px; stroke-linejoin: round; }\nsvg.stg .xhair { stroke: var(--text-2); stroke-width: 1; }\nsvg.stg .hov { fill: transparent; cursor: crosshair; }\n.focus svg.stg .sg { opacity: .3; } .focus svg.stg .sg.on { opacity: 1; } .focus svg.stg .sg.on .line { stroke-width: 3; }\nsvg.stg foreignObject div { font-family: var(--f-body); }\nsvg.stg .strip { font-size: 12.5px; line-height: 1.4; color: var(--text-2); }\nsvg.stg .fault { font-size: 12px; line-height: 1.35; color: var(--text); background: var(--surface); border: 1px solid var(--warn-line); border-left-width: 1px; border-radius: 6px; padding: 5px 8px; box-shadow: 0 0 0 3px var(--warn-soft); }\n.info .stages { display: grid; gap: 10px; }\n.info .stages .stage { padding: 8px 10px 6px; }\n.tip .tval { font: 700 13px var(--f-mono); }\n.tip .trow { display: flex; align-items: center; gap: 6px; }\n.tip .tkey { display: inline-block; width: 12px; height: 0; border-top: 2px solid var(--sc); }\n.info .stage h3 { font: 650 14px var(--f-display); letter-spacing: normal; text-transform: none; color: var(--text); margin: 0; }\n.info #stage-slot > h3 { margin-bottom: 8px; }\n.stage .sfault { margin: 2px 0 0; font-size: 13px; line-height: 1.45; color: var(--text); border: 1px solid var(--warn-line); background: var(--warn-soft); border-radius: 6px; padding: 6px 9px; }\n.stage .sfault::before { content: 'First board '; font: 700 10.5px var(--f-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--warn); }\n\n/* the big chart under the schematic */\n.sd { border-top: 1px solid var(--line); display: grid; gap: 8px; padding: 12px 0 0; min-width: 0; }\n.sd-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px; padding: 0 12px; }\n.sd-head { display: grid; gap: 6px; min-width: 0; }\n.sd-head h3 { font-size: 15.5px; font-weight: 650; }\n.sd-tabs { display: flex; flex-wrap: wrap; gap: 4px; }\n.sd-tabs:empty { display: none; }\n.sd-tabs button { border: 1px solid var(--line-2); background: var(--surface); border-radius: 999px; padding: 2px 10px; font-size: 12.5px; font-weight: 600; cursor: pointer; color: var(--text-2); }\n.sd-tabs button[aria-pressed=\"true\"] { background: var(--text); color: var(--bg); border-color: var(--text); }\n.sd .zoom button:disabled { opacity: .45; cursor: default; }\n.sd-note { margin: 0 12px; font-size: 13px; color: var(--text-2); }\n.sd-legend { padding: 0 12px; }\n.sd-view { min-width: 0; overflow: hidden; background: var(--surface); cursor: crosshair; touch-action: pan-y; }\n.sd-view.dragging, .sd-view.dragging .hov { cursor: grabbing; }\n.sd-view svg.stg { width: 100%; height: auto; }\n.sd-cap { display: grid; gap: 8px; padding: 0 12px; }\n.sd-cap p { margin: 0; font-size: 14px; color: var(--text-2); line-height: 1.55; max-width: 80ch; }\n.sd-cap p.hint { font-size: 12.5px; color: var(--text-3); }\n.sd-cap .sfault, .stage .sfault { margin: 0; font-size: 13.5px; line-height: 1.45; color: var(--text); border: 1px solid var(--warn-line); background: var(--warn-soft); border-radius: 6px; padding: 6px 9px; }\n.sd-cap .sfault::before { content: 'First board '; font: 700 10.5px var(--f-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--warn); }\n.sd-follow { padding: 0 12px; }\n.sd-follow:empty { display: none; }\n.follow { border: 1px solid var(--line-2); border-radius: 8px; background: var(--surface-2); padding: 8px 10px; display: grid; gap: 6px; }\n.follow .fh { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; color: var(--text-2); }\n.follow .fh b { color: var(--text); }\n.follow .fh button { border: 1px solid var(--line-2); background: var(--surface); border-radius: 6px; padding: 2px 9px; font-size: 12px; font-weight: 600; cursor: pointer; }\n.follow .fwrap { overflow-x: auto; }\n.follow table { border-collapse: collapse; width: 100%; font-size: 13px; font-variant-numeric: tabular-nums; }\n.follow th { text-align: left; font-weight: 600; color: var(--text-3); padding: 3px 10px 3px 0; border-bottom: 1px solid var(--line); font-size: 12px; }\n.follow td { padding: 3px 10px 3px 0; border-bottom: 1px solid var(--line); color: var(--text-2); }\n.follow .n { font-family: var(--f-mono); text-align: right; white-space: nowrap; }\n.follow th.n { text-align: right; }\n.follow td.gone { color: var(--text-3); font-family: var(--f-body); }\n.follow tr[data-st] { cursor: pointer; }\n.follow tr[data-st]:hover td, .follow tr.cur td { background: var(--surface); }\n.follow tr.cur td:first-child { box-shadow: inset 3px 0 0 var(--sig-st, var(--accent-fill)); }\nsvg.stg.big .tk { font-size: 12px; }\n/* waveform view (scope.js): what an oscilloscope on the node shows */\nsvg.stg.scope .tr { fill: none; stroke: var(--sig-st); stroke-width: 1.6; stroke-linejoin: round; }\nsvg.stg.scope .tr.soft { stroke-width: 1.3; }\nsvg.stg.scope .tr.faint { stroke: var(--text-3); stroke-dasharray: 4 3; }\nsvg.stg.scope .tr.ghost { stroke: var(--text-3); stroke-width: 1.2; stroke-dasharray: 5 3; opacity: .8; }\nsvg.stg.scope .band { fill: var(--sig-st); opacity: .32; }\nsvg.stg.scope .ghostband { fill: none; stroke: var(--text-3); stroke-width: 1.2; stroke-dasharray: 5 3; }\nsvg.stg.scope .dot { fill: var(--sig-st); stroke: var(--surface); stroke-width: 1; }\nsvg.stg.scope .dot.sm { fill: var(--text-2); stroke: none; }\nsvg.stg.scope .pk { fill: var(--sig-st); opacity: .85; }\nsvg.stg.scope .ref.thr { stroke: var(--text-2); stroke-dasharray: 5 3; }\nsvg.stg.scope .sweep { stroke: var(--text-2); stroke-width: 1; stroke-dasharray: 2 3; }\nsvg.stg.scope .pkt { fill: var(--sig-st); fill-opacity: .07; stroke: var(--line-2); }\nsvg.stg.scope .refl { paint-order: stroke; stroke: var(--surface); stroke-width: 4px; stroke-linejoin: round; }\nsvg.stg.scope .dl.rd { font-family: var(--f-mono); }\nsvg.stg.scope .pktt { stroke: var(--sig-st); stroke-width: 1.4; opacity: .7; }\n.seg.dom button { padding: 3px 10px; font-size: 12.5px; }\nsvg.stg.big .pl { font-size: 12.5px; }\nsvg.stg.big .refl { font-size: 11.5px; }\nsvg.stg.big .dl { font-size: 13px; stroke-width: 4px; }\nsvg.stg.big .dl.minor { font-weight: 500; fill: var(--text-2); font-size: 12px; }\nsvg.stg.big .strip { font-size: 14px; line-height: 1.45; }\nsvg.stg.big .sg .line { stroke-width: 2.2; }\nsvg.stg .dl.minor { font-weight: 500; fill: var(--text-2); }\n.pinned svg.stg .sg { opacity: .3; } .pinned svg.stg .sg.pin { opacity: 1; } .pinned svg.stg .sg.pin .line { stroke-width: 3.2; }\n.focus svg.stg .sg.on { opacity: 1; }\n.tip .hintline { opacity: .65; font-size: 11.5px; margin-top: 2px; }\n@container xp (max-width: 900px) { .sd-view svg.stg { max-width: 100%; } }\n/* mixers: before and after, joined by where each signal moved */\nsvg.stg path.map { fill: none; stroke: var(--sc); stroke-width: 1.4; opacity: .55; }\nsvg.stg.big path.map { stroke-width: 1.8; }\nsvg.stg path.map.k-other { opacity: .28; }\nsvg.stg path.map.k-station { opacity: .9; }\nsvg.stg path.map.k-image { opacity: .85; stroke-dasharray: 5 3; }\n.focus svg.stg path.map.on, .pinned svg.stg path.map.pin { opacity: 1; stroke-width: 2.8; }\nsvg.stg .ref.lo { stroke: var(--text-2); stroke-width: 1.5; }\nsvg.stg .refl.lo { fill: var(--text); font-weight: 600; }\nsvg.stg.mixer .pl { paint-order: stroke; stroke: var(--surface); stroke-width: 5px; stroke-linejoin: round; }\n.spec-legend i.curve { width: 16px; height: 9px; border: 0; border-top: 2px solid var(--sc); border-radius: 50% 50% 0 0 / 100% 100% 0 0; }\n\n/* RF block diagram */\nsvg.flow { min-width: 900px; }\nsvg.flow .rf { --gc: var(--dig); --gs: var(--dig-soft); cursor: pointer; }\nsvg.flow .rf.fm { --gc: var(--fm); --gs: var(--fm-soft); } svg.flow .rf.am { --gc: var(--am); --gs: var(--am-soft); }\nsvg.flow .rf.if { --gc: var(--if); --gs: var(--if-soft); } svg.flow .rf.ctrl { --gc: var(--ctrl); --gs: var(--ctrl-soft); }\nsvg.flow .rf.term { --gc: var(--text-3); cursor: default; }\nsvg.flow .rf .s { fill: var(--surface); stroke: var(--gc); stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }\nsvg.flow .rf .sf { fill: var(--gc); stroke: none; }\nsvg.flow .rf .g { fill: none; stroke: var(--gc); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }\nsvg.flow .rf .gx { fill: none; stroke: var(--line-2); stroke-width: 1; }\nsvg.flow .rf .st { font: 600 9.5px var(--f-mono); fill: var(--text-2); }\nsvg.flow .rf .st.sm { font-size: 8.5px; font-weight: 500; }\nsvg.flow .rf .st.big { font: 400 19px 'STIX Two Text', serif; fill: var(--gc); }\nsvg.flow .rf .hit { fill: transparent; }\nsvg.flow .rf .mcubox { fill: none; stroke: var(--dig); stroke-width: 1.4; }\nsvg.flow .lt { font: 650 12px var(--f-display); fill: var(--text); }\nsvg.flow .le { font: 400 12.5px 'STIX Two Text', 'Cambria Math', 'Times New Roman', serif; fill: var(--text-2); }\nsvg.flow .le .mv { font-style: italic; }\nsvg.flow .le .ms { font-size: 9px; }\nsvg.flow .lv { font: 600 10.5px var(--f-mono); fill: var(--text); }\nsvg.flow .rfw .w { fill: none; stroke-width: 2; stroke-linejoin: round; }\nsvg.flow .rfw .w.fm { stroke: var(--fm); } svg.flow .rfw .w.am { stroke: var(--am); } svg.flow .rfw .w.if { stroke: var(--if); } svg.flow .rfw .w.dig { stroke: var(--dig); }\nsvg.flow .rfw .w.ctrl { stroke: var(--ctrl); stroke-width: 1.5; stroke-dasharray: 5 4; }\nsvg.flow .rfw.loop .w { stroke-dasharray: 6 4; }\nsvg.flow .rfw .wl { font: 500 9.5px var(--f-mono); fill: var(--text-2); paint-order: stroke; stroke: var(--surface); stroke-width: 4px; stroke-linejoin: round; }\nsvg.flow .rfw .wl.dyn { font-weight: 700; fill: var(--text); }\nsvg.flow .jn { fill: var(--text-2); }\nsvg.flow .rf:hover .s, svg.flow .rf.rel .s, svg.flow .rf:focus-visible .s { stroke-width: 2.6; }\nsvg.flow .rf.sel .s { stroke-width: 2.8; fill: var(--gs); }\nsvg.flow .rf.sel .lt { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }\nsvg.flow .rf.off { opacity: .3; } svg.flow .rfw.off { opacity: .15; }\nsvg.flow .rfw.hot .w { stroke-width: 3.2; }\nsvg.flow .rf .warn { fill: var(--warn); }\nsvg.flow .rf:focus { outline: none; }\n.tip .teq { font: 14px/1.5 'STIX Two Text', 'Cambria Math', serif; margin: 1px 0 4px; }\n.tip .teq .frac .fn { border-bottom-color: var(--bg); }\n\n/* the math in each block */\n.mathbox { border: 1px solid var(--line-2); border-radius: 8px; padding: 10px 12px; display: grid; gap: 10px; background: var(--surface-2); min-width: 0; }\n.mathbox:empty { display: none; }\n.mathbox h3 { margin: 0; }\n.mrow { display: grid; gap: 4px; min-width: 0; }\n.mk { font: 600 11px var(--f-mono); letter-spacing: .05em; text-transform: uppercase; color: var(--text-3); }\n.mv { min-width: 0; overflow-x: auto; }\n.mv p { margin: 0; color: var(--text); font-size: 14px; line-height: 1.55; }\n.eq { font: 17px/1.9 'STIX Two Text', 'Cambria Math', 'Times New Roman', serif; color: var(--text); white-space: nowrap; }\n.eq i, .mnums i { font-style: italic; }\n.eq sub, .mnums sub { font-size: .68em; }\n.frac { display: inline-flex; flex-direction: column; vertical-align: middle; text-align: center; margin: 0 .2em; line-height: 1.25; text-indent: 0; }\n.frac .fn { border-bottom: 1px solid currentColor; padding: 0 .25em .05em; }\n.frac .fd { padding: .05em .25em 0; }\n.mnums { margin: 0; padding-left: 18px; display: grid; gap: 4px; font: 15px/1.5 'STIX Two Text', 'Cambria Math', serif; color: var(--text); }\n.mnums .frac { font-size: .9em; }\n/* the math as a derivation: In, numbered steps on a rail, Out */\n.sch-col > .mathbox { margin: 14px 12px 16px; }\n.sch-col > .mathbox h3 { font: 700 11px var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); margin: 0; }\n.eq sup { font-size: .7em; }\n.msub { margin: -4px 0 0; font-size: 13px; color: var(--text-2); }\n.chain { list-style: none; margin: 0; padding: 0; display: grid; }\n.chain li { position: relative; min-width: 0; }\n.chain .cin, .chain .cout { border: 1px solid var(--line-2); border-radius: 8px; background: var(--surface); padding: 8px 10px 8px; }\n.chain .cout { border-left: 3px solid var(--sig-st, var(--accent-fill)); }\n.chain .cin { border-left: 3px solid var(--text-3); }\n.chain .ctag { display: block; font: 600 10.5px var(--f-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); margin-bottom: 1px; }\n.chain .cop { padding: 10px 4px 10px 36px; }\n.chain .cop::before { content: ''; position: absolute; left: 13px; top: 0; bottom: 0; width: 2px; background: var(--line-2); }\n.chain .cn { position: absolute; left: 3px; top: 9px; width: 22px; height: 22px; border-radius: 50%; background: var(--surface); border: 1.5px solid var(--text-3); display: grid; place-items: center; font: 600 11px var(--f-mono); color: var(--text); }\n.chain .chead { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; margin-bottom: 2px; }\n.chain .cname { font: 600 14px/1.35 var(--f-body); color: var(--text); }\n.chain .cby { font: 500 11px var(--f-mono); color: var(--text-2); border: 1px solid var(--line-2); border-radius: 4px; padding: 0 5px; }\n.chain .cdom { font: 600 10.5px var(--f-body); color: var(--text-2); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 0 7px; }\n.chain .eq { font-size: 16.5px; line-height: 1.75; white-space: normal; padding-left: 1em; text-indent: -1em; }\n.chain .cnote { margin: 2px 0 0; font-size: 13px; line-height: 1.45; color: var(--text-2); }\n.chain .cnote i { font-family: 'STIX Two Text', 'Cambria Math', serif; font-size: 1.08em; }\n.drop { color: var(--text-3); text-decoration: line-through; text-decoration-thickness: 1.5px; }\n.drop .fn, .drop .fd { text-decoration: line-through; text-decoration-thickness: 1.5px; }\n.mhow { border-top: 1px solid var(--line); padding-top: 8px; }\n.mhow summary { cursor: pointer; font: 600 12px var(--f-mono); letter-spacing: .05em; text-transform: uppercase; color: var(--text-2); }\n.mhow p { margin: 6px 0 0; font-size: 13.5px; line-height: 1.55; color: var(--text); }\n@container xp (max-width: 600px) { .chain .eq { font-size: 15px; } .chain .cop { padding-left: 32px; } .sch-col > .mathbox { margin-inline: 8px; } }\n\n/* STM32 controls */\n.ctl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr)); gap: 12px; padding: 12px 16px 16px; }\n.ccard { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; display: grid; gap: 8px; align-content: start; background: var(--surface); min-width: 0; }\n.ccard .ch { display: grid; gap: 2px; }\n.ccard .ch b { font: 650 14px var(--f-display); }\n.ccard .pin { font: 500 11px var(--f-mono); color: var(--text-3); }\n.ccard .ro { margin: 0; font-size: 12.5px; line-height: 1.45; color: var(--text-2); }\n.seg.sm button { padding: 3px 10px; font-size: 12.5px; }\n.seg button:disabled { opacity: .4; cursor: default; }\n.sl { display: grid; grid-template-columns: auto minmax(0, 1fr) 4.5em; gap: 8px; align-items: center; font-size: 12.5px; color: var(--text-2); }\n.sl input[type=range] { width: 100%; accent-color: var(--accent-fill); }\n.sl input:disabled { opacity: .4; }\n.sl output { font: 600 12.5px var(--f-mono); color: var(--text); text-align: right; font-variant-numeric: tabular-nums; }\n.ck { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; color: var(--text); cursor: pointer; }\n.ck input { accent-color: var(--accent-fill); }\n.ck input:disabled + * { opacity: .5; }\n.ckrow { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; }\n.ckrow .lbl { font-size: 12.5px; color: var(--text-2); }\n.sd-ctl { padding: 0 12px; }\n.sd-ctl:empty { display: none; }\n.sdc-h { font: 600 11px var(--f-mono); letter-spacing: .05em; text-transform: uppercase; color: var(--text-3); margin-bottom: 6px; }\n.sdc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 10px; }\n.sd-ctl .ccard { background: var(--surface-2); border-color: var(--line-2); }\n\n/* step player */\n.sd-play { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; padding: 0 12px; }\n.sd-play .play { border: 0; background: var(--accent-fill); color: var(--on-accent); border-radius: 7px; padding: 6px 14px; font-weight: 700; font-size: 13.5px; cursor: pointer; }\n.sd-play .play:hover { filter: brightness(1.06); }\n.sd-steps { display: flex; flex-wrap: wrap; gap: 4px; }\n.sd-steps button { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-2); background: var(--surface); border-radius: 999px; padding: 3px 10px 3px 4px; font-size: 12.5px; font-weight: 600; color: var(--text-2); cursor: pointer; }\n.sd-steps button .n { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--surface-2); font: 700 10.5px var(--f-mono); color: var(--text-2); }\n.sd-steps button[aria-pressed=\"true\"] { border-color: var(--text); color: var(--text); }\n.sd-steps button[aria-pressed=\"true\"] .n { background: var(--text); color: var(--bg); }\n\n/* the part being applied, laid over the spectrum */\nsvg.stg .maskfill { fill: var(--text); opacity: .07; }\nsvg.stg .maskline { fill: none; stroke: var(--text-2); stroke-width: 1.6; stroke-dasharray: 6 4; }\nsvg.stg .masklabel { font: 600 12px var(--f-body); fill: var(--text); paint-order: stroke; stroke: var(--surface); stroke-width: 4px; stroke-linejoin: round; }\nsvg.stg .strip.stepnow { font-weight: 600; color: var(--text); }\nsvg.stg .mapdot { stroke: var(--surface); stroke-width: 2; fill: var(--sc); }\nsvg.stg .k-mark { --sc: var(--sig-img); }\n/* the continuous analyser trace: neutral base, coloured where one signal dominates */\nsvg.stg .tline { fill: none; stroke: var(--text-2); stroke-width: 1.2; stroke-linejoin: round; }\nsvg.stg .tfill { fill: var(--text-3); opacity: .13; }\nsvg.stg .gtrace { fill: none; stroke: var(--text-3); stroke-width: 1.2; stroke-dasharray: 4 3; stroke-linejoin: round; opacity: .75; }\nsvg.stg .bandmark { fill: var(--text); opacity: .05; }\nsvg.stg .bandlbl { font: 600 10px var(--f-body); fill: var(--text-2); letter-spacing: .02em; }\n/* mixer: the box the bottom panel magnifies, and the lines down to it */\nsvg.stg .zoombox { fill: var(--text); fill-opacity: .045; stroke: var(--text-2); stroke-width: 1.2; }\nsvg.stg .zoomline { fill: none; stroke: var(--text-3); stroke-width: 1; stroke-dasharray: 3 3; }\n.spec-legend i.zoombox { width: 11px; height: 9px; border: 1.2px solid var(--text-2); background: color-mix(in srgb, var(--text) 5%, transparent); }\nsvg.stg.big .bandlbl { font-size: 12px; }\nsvg.stg .sg.k-mark .line { stroke-width: 1.4; }\n.ccard .seg { justify-self: start; }\n.sd-steps .nosteps { font-size: 13px; color: var(--text-2); }\n/* monochrome icons: they take the text colour */\n.ico { width: 1.05em; height: 1.05em; flex: none; vertical-align: -0.17em; }\n.sd-play .play { display: inline-flex; align-items: center; gap: 6px; }\n.sd-steps button .n .ico { width: 12px; height: 12px; }\n.card .ct button .ico { width: 16px; height: 16px; }\n.sch-key .ico { width: 11px; height: 11px; vertical-align: -1px; }\n\n/* decluttered (2026-10-20): the essentials open, the rest one click away */\n.check { display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px; border: 1px solid var(--line-2); border-radius: 999px; font: 500 12px var(--f-mono); color: var(--text-2); cursor: help; }\n.check .ico { color: var(--fm); width: 13px; height: 13px; }\n.check.bad { color: var(--warn); border-color: var(--warn-line); }\nsvg.flow .le, svg.flow .lv { display: none; } /* each symbol's equation: in its hover tooltip and in the math */\n.sd-n { font: 500 12px var(--f-mono); color: var(--text-3); margin-left: 6px; letter-spacing: 0; }\ndetails.fold > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 6px; font: 600 13px var(--f-body); color: var(--text-2); padding: 4px 0; }\ndetails.fold > summary::-webkit-details-marker { display: none; }\ndetails.fold > summary:hover { color: var(--text); }\ndetails.fold > summary .chev { width: 14px; height: 14px; transition: transform .15s ease; }\ndetails.fold[open] > summary .chev { transform: rotate(90deg); }\ndetails.fold > summary h3 { margin: 0; }\ndetails.fold .msub { margin: 0 0 0 4px; font-size: 12.5px; color: var(--text-3); }\n.mathfold[open] > summary { margin-bottom: 8px; }\n.partsbox[open] > summary, .more[open] > summary { margin-bottom: 6px; }\n.sdcfold { padding: 0 0 4px; }\n.sdcfold[open] > summary { margin-bottom: 8px; }\n\n/* The wiki widget's brand layer (Adom brand guide, adom/brand): dark always, teal primary, purple for the AM\n group, blue for the shared IF, Familjen Grotesk / Satoshi / JetBrains Mono (the wiki page already loads them).\n widget.py puts it after sch.css and page.css, inside the element's shadow root. */\n:host {\n display: block;\n color-scheme: dark;\n font-synthesis: none; /* the wiki loads Satoshi 400/500 only: no faux bold */\n --bg: #0d1117; --surface: #161b22; --surface-2: #1c2128; --line: #30363d; --line-2: #484f58;\n --text: #e6edf3; --text-2: #8b949e; --text-3: color-mix(in srgb, #8b949e 82%, #0d1117);\n --accent: #00b8b1; --accent-fill: #00b8b1; --accent-bright: #00e6dc; --on-accent: #0d1117;\n --fm: #00b8b1; --fm-soft: rgba(0, 184, 177, .12);\n --am: #8c6bf7; --am-soft: rgba(140, 107, 247, .13);\n --if: #64abff; --if-soft: rgba(100, 171, 255, .11);\n --ctrl: #8fd3d4; --ctrl-soft: rgba(143, 211, 212, .10);\n --dig: #8b949e; --dig-soft: rgba(139, 148, 158, .10);\n --warn: #d29922; --warn-soft: rgba(210, 153, 34, .10); --warn-line: rgba(210, 153, 34, .45);\n --hl: #00e6dc;\n --sig-fm: #00b8b1; --sig-am: #8c6bf7; --sig-img: #c5b3ff; --sig-sub: #64abff; --sig-other: #8b949e;\n --paper: #0d1117; --grid: rgba(139, 148, 158, .07);\n --s-ink: #e6edf3; --s-ink2: #8b949e; --s-wire: #e6edf3; /* wires in the same ink as the symbols */ --s-val: #00b8b1; --s-flag: #c5b3ff;\n --s-flagbg: rgba(140, 107, 247, .12); --s-tp: #8fd3d4; --s-region: rgba(139, 148, 158, .35);\n --f-display: 'Familjen Grotesk', -apple-system, 'Segoe UI', sans-serif;\n --f-body: 'Satoshi', -apple-system, 'Segoe UI', sans-serif;\n --f-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;\n --r: 10px;\n --glass: rgba(22, 27, 34, .92);\n --glass-line: rgba(0, 184, 177, .2);\n}\n/* the artifact's page skeleton supplies this; a shadow root does not inherit it, and the code toggles .hidden */\n[hidden] { display: none !important; }\n.band-am { --sig-img: #8fd3d4; }\nsvg.sch { --hl: #00e6dc; } /* sch.css sets its own highlight on the svg: the brand's hover teal instead */ /* the calibration marker, kept apart from the AM station's purple */\n\n/* the widget sits in the README column: the README's own heading names it, the page scrolls, not the widget */\n.app { container: xp / inline-size; background: var(--bg); color: var(--text); font: 15px/1.55 var(--f-body); }\n.app .wrap { max-width: none; padding: 0; gap: 16px; }\n.top .title { font: 700 24px/1.1 var(--f-display); letter-spacing: -.01em; margin-top: 6px; text-wrap: balance; }\n.top .title .fm { color: var(--fm); } .top .title .am { color: var(--am); }\n.lede { max-width: 72ch; margin: 0; }\n.toplinks { max-width: 400px; text-align: right; }\n.top { align-items: center; }\n.top .eyebrow, .top .title { display: none; } /* the README's own heading names the explorer */\n\n/* type: Familjen for headings, Satoshi (400/500) for text, JetBrains Mono for numbers and parts */\nh1, h2, h3, .role, .stage h3, .sd-head h3 { font-family: var(--f-display); }\nb, strong, .seg button, .tabs button, .presets button, .stage .open, .sd-tabs button, .sd-steps button, .chip, .play { font-weight: 500; }\n\n/* links and focus */\na { color: var(--accent); text-decoration: none; transition: color .15s ease; }\na:hover { color: var(--accent-bright); text-decoration: underline; }\n:focus-visible { outline: 2px solid var(--accent-bright); outline-offset: 2px; }\ncode { border-radius: 6px; background: var(--surface-2); }\n\n/* every hover eases at 0.15 s */\nbutton, .seg button, .tabs button, .presets button, .chip, .sd-steps button, .sd-tabs button, .card .pins button, .menu button, .nav button, .zoom button, .stage .open, .follow tr td, .parts tr td {\n transition: background .15s ease, color .15s ease, border-color .15s ease, box-shadow .15s ease;\n}\n\n/* cards: 10 px corners, buttons at least 6 px */\n.panel, .stage, .ccard, .card, .mathbox, .follow, .board, .sd-ctl .ccard { border-radius: 10px; }\n.freq, .chain .cin, .chain .cout { border-radius: 8px; }\n.nav button, .zoom button, .stage .open, .follow .fh button, .card .pins button, .find input { border-radius: 6px; }\n\n/* segmented controls and tabs: teal for the chosen one */\n.seg { border-color: var(--line-2); border-radius: 8px; }\n.seg button:hover { color: var(--text); background: rgba(0, 184, 177, .06); }\n.seg button[aria-pressed=\"true\"] { background: rgba(0, 184, 177, .16); color: var(--accent-bright); }\n.seg.band button[data-band=\"fm\"][aria-pressed=\"true\"] { background: var(--fm); color: #0d1117; }\n.seg.band button[data-band=\"am\"][aria-pressed=\"true\"] { background: var(--am); color: #0d1117; }\n.tabs { background: var(--bg); border: 1px solid var(--line); }\n.tabs button[aria-selected=\"true\"] { background: var(--surface-2); color: var(--text); box-shadow: inset 0 0 0 1px rgba(0, 184, 177, .35); }\n.tabs button:hover { color: var(--text); }\n.presets button:hover, .nav button:hover, .zoom button:hover, .stage .open:hover, .card .pins button:hover { border-color: var(--accent); color: var(--text); }\n.sd-tabs button[aria-pressed=\"true\"] { background: rgba(0, 184, 177, .16); color: var(--accent-bright); border-color: rgba(0, 184, 177, .45); }\n\n/* the step player: the brand's primary button */\n.sd-play .play { background: var(--accent-fill); color: var(--on-accent); border-radius: 6px; }\n.sd-play .play:hover { background: var(--accent-bright); filter: none; }\n.sd-steps button[aria-pressed=\"true\"] { border-color: var(--accent); color: var(--text); }\n.sd-steps button[aria-pressed=\"true\"] .n { background: var(--accent-fill); color: var(--on-accent); }\n.sd-steps button:hover { border-color: var(--accent); }\n\n/* frosted-glass tooltips and menus */\n.tip { background: var(--glass); color: var(--text); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);\n border: 1px solid var(--glass-line); border-radius: 10px; box-shadow: 0 12px 40px rgba(0, 0, 0, .55); }\n.tip .teq .frac .fn { border-bottom-color: currentColor; }\n.menu { background: var(--glass); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);\n border: 1px solid var(--glass-line); border-radius: 10px; box-shadow: 0 12px 40px rgba(0, 0, 0, .55); }\n.menu button:hover, .menu button:focus-visible { background: rgba(0, 184, 177, .10); }\n\n/* panels: a quiet teal inner edge, as the brand's viewers do */\n.panel { box-shadow: inset 0 0 0 1px rgba(0, 184, 177, .04); }\n.chip.ctrl { color: var(--ctrl); }\n.stage .sfault::before, .sd-cap .sfault::before { color: var(--warn); }\n";
var HTML = "<div class=\"app\"><div class=\"wrap\">\n <header class=\"top\">\n <div>\n <div class=\"eyebrow\">Adom Molecule \u00b7 rev B \u00b7 4 layers, 102.5 mm square</div>\n <div class=\"title\" role=\"heading\" aria-level=\"3\">AM/FM Receiver Explorer</div>\n <p class=\"lede\">Follow a station from the antenna to the USB audio: pick a band and a station, then click any block.</p>\n </div>\n <div class=\"toplinks\">\n <span class=\"check\" id=\"check\"></span>\n </div>\n </header>\n\n <section class=\"panel tuner\" id=\"tuner\" aria-label=\"Station tuner\">\n <div class=\"tuner-ctl\">\n <div class=\"ctl-row\">\n <span class=\"ctl-label\">Band</span>\n <div class=\"seg band\" id=\"band\"><button type=\"button\" data-band=\"fm\" aria-pressed=\"true\">FM</button><button type=\"button\" data-band=\"am\" aria-pressed=\"false\">AM</button></div>\n </div>\n <div class=\"ctl-row\">\n <span class=\"ctl-label\">Show</span>\n <div class=\"seg\" id=\"mode\"><button type=\"button\" data-mode=\"design\" aria-pressed=\"true\">As designed</button><button type=\"button\" data-mode=\"board\" aria-pressed=\"false\">First board</button></div>\n </div>\n <div class=\"station\">\n <label class=\"ctl-label\" for=\"f-in\">Station</label>\n <div class=\"station-read\"><input id=\"f-in\" inputmode=\"decimal\" autocomplete=\"off\" aria-label=\"Station frequency\"><span id=\"f-unit\">MHz</span></div>\n <input type=\"range\" id=\"f-range\" aria-label=\"Station frequency slider\">\n <div class=\"presets\" id=\"presets\"></div>\n </div>\n </div>\n <div class=\"tuner-out\">\n <div class=\"freqs\" id=\"freqs\"></div>\n <p class=\"verdict\" id=\"verdict\"></p>\n <div class=\"spec-wrap\"><svg class=\"spec\" id=\"spec\" role=\"img\" aria-label=\"Where the station, oscillator and image sit on the frequency axis\"></svg></div>\n </div>\n </section>\n\n <section class=\"panel\" id=\"flow-panel\" aria-label=\"Signal path\">\n <div class=\"panel-h\">\n <h2>Signal path</h2>\n <div class=\"tabs\" role=\"tablist\" aria-label=\"View\">\n <button type=\"button\" role=\"tab\" id=\"tab-flow\" aria-controls=\"view-flow\" aria-selected=\"true\">Block diagram</button>\n <button type=\"button\" role=\"tab\" id=\"tab-spec\" aria-controls=\"view-spec\" aria-selected=\"false\">Signal at each stage</button>\n <button type=\"button\" role=\"tab\" id=\"tab-ctl\" aria-controls=\"view-ctl\" aria-selected=\"false\">STM32 controls</button>\n </div>\n </div>\n <div id=\"view-flow\" role=\"tabpanel\" aria-labelledby=\"tab-flow\">\n <div class=\"view-note\">\n <div class=\"flow-legend\">\n <span><i style=\"background:var(--fm)\"></i>FM path</span>\n <span><i style=\"background:var(--am)\"></i>AM path</span>\n <span><i style=\"background:var(--if)\"></i>shared IF</span>\n <span class=\"ctrl\"><i></i>tuning & control</span>\n <span><i style=\"background:var(--dig)\"></i>digital</span>\n </div>\n <span class=\"hint\">Click a block to open it below; hover it for its equations.</span>\n </div>\n <div class=\"flow-scroll\"><svg class=\"flow\" id=\"flow\" role=\"group\" aria-label=\"Block diagram of the receiver\"></svg></div>\n </div>\n <div id=\"view-spec\" role=\"tabpanel\" aria-labelledby=\"tab-spec\" hidden>\n <div class=\"view-note spec-note\">\n <p class=\"hint\">Every stage in signal order for the station in the tuner: what it applies, and the signal it puts out. A model from the part values and datasheets, not a measurement; estimated gains are marked.</p>\n <div class=\"spec-legend\" id=\"spec-legend\"></div>\n </div>\n <div class=\"spec-grid\" id=\"spec-grid\"></div>\n </div>\n <div id=\"view-ctl\" role=\"tabpanel\" aria-labelledby=\"tab-ctl\" hidden>\n <div class=\"view-note\"><span class=\"hint\">What the firmware sets, from the pins out. The tuner, the diagram, the charts and the math follow every change.</span></div>\n <div class=\"ctl-grid\" id=\"ctl-grid\"></div>\n </div>\n </section>\n\n <section class=\"panel detail\" id=\"detail\" aria-live=\"polite\">\n <div class=\"detail-h\">\n <div>\n <h2 id=\"d-title\"></h2>\n <div class=\"chips\" id=\"d-chips\"></div>\n </div>\n <div class=\"nav\">\n <button type=\"button\" id=\"to-flow\">Flowchart</button>\n <button type=\"button\" id=\"prev\">Previous</button>\n <button type=\"button\" id=\"next\">Next</button>\n </div>\n </div>\n <div class=\"sch-col\">\n <div class=\"sch-bar\">\n <div class=\"zoom\"><button type=\"button\" id=\"z-in\" aria-label=\"Zoom in\">+</button><button type=\"button\" id=\"z-out\" aria-label=\"Zoom out\">\u2212</button><button type=\"button\" id=\"z-fit\">Fit</button></div>\n <form class=\"find\" id=\"find\" role=\"search\">\n <input id=\"find-in\" list=\"find-list\" placeholder=\"R303, VT_FM\u2026\" aria-label=\"Find a part or net\" autocomplete=\"off\">\n <datalist id=\"find-list\"></datalist>\n <button type=\"submit\" class=\"zoomish\" hidden>Find</button>\n <span class=\"msg\" id=\"find-msg\"></span>\n </form>\n </div>\n <div class=\"sch-view\" id=\"sch-view\" title=\"Hover a part or wire for details, click a part for its card. Drag to pan, ctrl + scroll to zoom.\"></div>\n <div class=\"sch-key\">\n <span><b class=\"k-flag\"><svg class=\"ico\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path d=\"M4 7h11l5 5-5 5H4z\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linejoin=\"round\"/></svg> NET</b> continues in another block (click)</span>\n <span><svg class=\"ico k-tp\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><circle cx=\"12\" cy=\"12\" r=\"6\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2.2\"/></svg> test pad \u00b7 <svg class=\"ico k-tp\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><rect x=\"6\" y=\"6\" width=\"12\" height=\"12\" fill=\"currentColor\"/></svg> machine contact</span>\n </div>\n <section class=\"sd\" id=\"sd\" aria-label=\"What this stage does to the signal\" hidden>\n <div class=\"sd-bar\">\n <div class=\"sd-head\">\n <h3 id=\"sd-title\">What this stage does to the signal</h3>\n <div class=\"sd-tabs\" id=\"sd-tabs\"></div>\n </div>\n <div class=\"seg sm dom\" id=\"sd-dom\" role=\"group\" aria-label=\"Show this stage as\" hidden><button type=\"button\" data-dom=\"time\">Waveform</button><button type=\"button\" data-dom=\"freq\">Spectrum</button></div>\n <div class=\"zoom\"><button type=\"button\" id=\"sz-in\" aria-label=\"Zoom in\">+</button><button type=\"button\" id=\"sz-out\" aria-label=\"Zoom out\">\u2212</button><button type=\"button\" id=\"sz-fit\">Fit</button><button type=\"button\" id=\"sz-st\">Your station</button></div>\n </div>\n <p class=\"sd-note\" id=\"sd-note\" hidden></p>\n <div class=\"sd-ctl\" id=\"sd-ctl\"></div>\n <div class=\"sd-play\" id=\"sd-play\" hidden>\n <button type=\"button\" class=\"play\" id=\"sp-play\" aria-label=\"Play the steps\"><svg class=\"ico\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path d=\"M8 5.5v13l10.5-6.5z\" fill=\"currentColor\"/></svg>Play the steps</button>\n <div class=\"sd-steps\" id=\"sd-steps\" role=\"group\" aria-label=\"Steps\"></div>\n </div>\n <div class=\"sd-legend spec-legend\" id=\"sd-legend\"></div>\n <div class=\"sd-view\" id=\"sd-view\" title=\"Hover to read the values. On a spectrum: click a peak to follow that signal through every stage, double-click to zoom, drag to pan.\"></div>\n <div class=\"sd-cap\" id=\"sd-cap\"></div>\n <div class=\"sd-follow\" id=\"sd-follow\"></div>\n </section>\n <div class=\"mathbox\" id=\"mathbox\"></div>\n </div>\n <div class=\"info\" id=\"info\"></div>\n </section>\n</div>\n<div class=\"tip\" id=\"tip\" hidden></div>\n<div class=\"menu\" id=\"menu\" hidden role=\"menu\"></div></div>";
function boot(EXPLORER_ROOT, EXPLORER_HOST) {
var DESIGN = {"parts":{"J101":{"value":"USB-C","lib":"Connector:USB_C_Receptacle_USB2.0_16P","desc":"USB 2.0 Type-C receptacle, 16P","lcsc":"C165948","mpn":"TYPE-C-31-M-12","sheet":"power","block":"usb","pins":{"A1":"GND","A12":"GND","B1":"GND","B12":"GND","A4":"VBUS","A9":"VBUS","B4":"VBUS","B9":"VBUS","A5":"CC1","B5":"CC2","A6":"USB_DP","B6":"USB_DP","A7":"USB_DM","B7":"USB_DM","A8":null,"B8":null,"SH":"GND"},"wiki":"https://wiki.adom.inc/adom/type-c-31-m-12"},"R101":{"value":"5.1k","lib":"Device:R","desc":"CC1 pull-down (UFP)","lcsc":"C23186","mpn":"","sheet":"power","block":"usb","pins":{"1":"CC1","2":"GND"},"wiki":"https://wiki.adom.inc/adom/0603waf5101t5e"},"R102":{"value":"5.1k","lib":"Device:R","desc":"CC2 pull-down (UFP)","lcsc":"C23186","mpn":"","sheet":"power","block":"usb","pins":{"1":"CC2","2":"GND"},"wiki":"https://wiki.adom.inc/adom/0603waf5101t5e"},"U101":{"value":"USBLC6-2SC6","lib":"Power_Protection:USBLC6-2SC6","desc":"USB ESD protection","lcsc":"C7519","mpn":"USBLC6-2SC6","sheet":"power","block":"usb","pins":{"1":"USB_DP","6":"USB_DP","3":"USB_DM","4":"USB_DM","2":"GND","5":"VBUS"},"wiki":"https://wiki.adom.inc/ray/usblc6-2sc6"},"D105":{"value":"B5819W","lib":"Device:D_Schottky","desc":"OR-ing diode: USB-C VBUS -> 5 V rail","lcsc":"C8598","mpn":"B5819W","sheet":"power","block":"usb","pins":{"1":"VIN_OR","2":"VBUS"},"wiki":"https://wiki.adom.inc/adom/b5819w"},"D106":{"value":"B5819W","lib":"Device:D_Schottky","desc":"OR-ing diode: machine-pin VIN (Adom control panel 5 V) -> 5 V rail","lcsc":"C8598","mpn":"B5819W","sheet":"power","block":"usb","pins":{"1":"VIN_OR","2":"VIN"},"wiki":"https://wiki.adom.inc/adom/b5819w"},"F101":{"value":"500mA","lib":"Device:Polyfuse","desc":"Resettable fuse 500 mA hold, 1206","lcsc":"C70077","mpn":"nSMD050-33V","sheet":"power","block":"usb","pins":{"1":"VIN_OR","2":"+5V"},"wiki":"https://wiki.adom.inc/adom/nsmd050-33v"},"C101":{"value":"10u","lib":"Device:C","desc":"Capacitor","lcsc":"C15850","mpn":"","sheet":"power","block":"usb","pins":{"1":"+5V","2":"GND"},"wiki":"https://wiki.adom.inc/adom/samsung-cl21a-x5r-0805"},"C102":{"value":"100n","lib":"Device:C","desc":"Capacitor","lcsc":"C14663","mpn":"","sheet":"power","block":"usb","pins":{"1":"+5V","2":"GND"},"wiki":"https://wiki.adom.inc/adom/cc0603-100nf"},"R107":{"value":"2.2k","lib":"Device:R","desc":"Power LED current limit","lcsc":"C4190","mpn":"","sheet":"power","block":"usb","pins":{"1":"+5V","2":"PWR_LED_A"},"wiki":"https://wiki.adom.inc/adom/uniroyal-0603waf"},"D104":{"value":"RED","lib":"Device:LED","desc":"Power LED, red 0603","lcsc":"C2286","mpn":"KT-0603R","sheet":"power","block":"usb","pins":{"1":"GND","2":"PWR_LED_A"},"wiki":"https://wiki.adom.inc/barrett-land/kt-0603r"},"U102":{"value":"AP2112K-3.3","lib":"Regulator_Linear:AP2112K-3.3","desc":"600 mA 3.3 V LDO","lcsc":"C51118","mpn":"AP2112K-3.3TRG1","sheet":"power","block":"reg","pins":{"1":"+5V","2":"GND","3":"+5V","4":null,"5":"+3V3"},"wiki":"https://wiki.adom.inc/adom/ap2112k-3-3trg1"},"C103":{"value":"1u","lib":"Device:C","desc":"Capacitor","lcsc":"C15849","mpn":"","sheet":"power","block":"reg","pins":{"1":"+5V","2":"GND"},"wiki":"https://wiki.adom.inc/adom/cl10a105kb8nnnc"},"C104":{"value":"10u","lib":"Device:C","desc":"Capacitor","lcsc":"C15850","mpn":"","sheet":"power","block":"reg","pins":{"1":"+3V3","2":"GND"},"wiki":"https://wiki.adom.inc/adom/samsung-cl21a-x5r-0805"},"C105":{"value":"100n","lib":"Device:C","desc":"Capacitor","lcsc":"C14663","mpn":"","sheet":"power","block":"reg","pins":{"1":"+3V3","2":"GND"},"wiki":"https://wiki.adom.inc/adom/cc0603-100nf"},"FB101":{"value":"600R@100MHz","lib":"Device:FerriteBead","desc":"Ferrite bead, 600 ohm @ 100 MHz, 0603","lcsc":"C1002","mpn":"GZ1608D601TF","sheet":"power","block":"reg","pins":{"1":"+5V","2":"+5VA"},"wiki":"https://wiki.adom.inc/adom/gz1608d601tf"},"C106":{"value":"22u","lib":"Device:C","desc":"Capacitor","lcsc":"C45783","mpn":"","sheet":"power","block":"reg","pins":{"1":"+5VA","2":"GND"},"wiki":"https://wiki.adom.inc/adom/samsung-cl21a-x5r-0805"},"C107":{"value":"100n","lib":"Device:C","desc":"Capacitor","lcsc":"C14663","mpn":"","sheet":"power","block":"reg","pins":{"1":"+5VA","2":"GND"},"wiki":"https://wiki.adom.inc/adom/cc0603-100nf"},"FB102":{"value":"600R@100MHz","lib":"Device:FerriteBead","desc":"Ferrite bead, 600 ohm @ 100 MHz, 0603","lcsc":"C1002","mpn":"GZ1608D601TF","sheet":"power","block":"reg","pins":{"1":"+3V3","2":"+3.3VA"},"wiki":"https://wiki.adom.inc/adom/gz1608d601tf"},"C108":{"value":"1u","lib":"Device:C","desc":"VREF+ bulk","lcsc":"C15849","mpn":"","sheet":"power","block":"reg","pins":{"1":"+3.3VA","2":"GND"},"wiki":"https://wiki.adom.inc/adom/cl10a105kb8nnnc"},"C109":{"value":"10n","lib":"Device:C","desc":"VREF+ HF decoupling","lcsc":"C57112","mpn":"","sheet":"power","block":"reg","pins":{"1":"+3.3VA","2":"GND"},"wiki":"https://wiki.adom.inc/adom/fenghua-0603-mlcc"},"U103":{"value":"STM32G0B1CCU7","lib":"MCU_ST_STM32G0:STM32G0B1CCUx","desc":"ARM Cortex-M0+ MCU, 256 KB flash, 144 KB RAM, USB FS + ROM DFU, 12-bit ADC + dual 12-bit DAC","lcsc":"C29759424","mpn":"STM32G0B1CCU7","sheet":"power","block":"mcu","pins":{"1":null,"2":null,"3":null,"4":"+3.3VA","5":"+3.3VA","6":"+3V3","7":"GND","8":"HSE_IN","9":"HSE_OUT","10":"NRST","11":"AM_AUDIO","12":"FM_AUDIO","13":"RSSI_AM","14":"FM_DC","15":"DAC_FM","16":"DAC_AM","17":"RSSI_FM","18":null,"19":null,"20":"PWM_RF","21":null,"22":null,"23":null,"24":null,"25":"LED_FM","26":"LED_AM","27":"LED_STAT","28":"CAL_MARK","29":null,"30":null,"31":null,"32":null,"33":"USB_DM","34":"USB_DP","35":"SWDIO","36":"SWCLK","37":"IF_CNT","38":null,"39":null,"40":null,"41":null,"42":null,"43":null,"44":null,"45":"UART_TX","46":"UART_RX","47":"FM_EN_N","48":"AM_EN_N","49":"GND"},"wiki":"https://wiki.adom.inc/adom/stm32g0b1ccu7"},"C110":{"value":"100n","lib":"Device:C","desc":"VBAT (tied to the VREF+ rail: they share an escape at the QFN)","lcsc":"C14663","mpn":"","sheet":"power","block":"mcu","pins":{"1":"+3.3VA","2":"GND"},"wiki":"https://wiki.adom.inc/adom/cc0603-100nf"},"C111":{"value":"100n","lib":"Device:C","desc":"VDD decoupling","lcsc":"C14663","mpn":"","sheet":"power","block":"mcu","pins":{"1":"+3V3","2":"GND"},"wiki":"https://wiki.adom.inc/adom/cc0603-100nf"},"C114":{"value":"4.7u","lib":"Device:C","desc":"MCU bulk","lcsc":"C1779","mpn":"","sheet":"power","block":"mcu","pins":{"1":"+3V3","2":"GND"},"wiki":"https://wiki.adom.inc/adom/cl21a475kaqnnng"},"C115":{"value":"100n","lib":"Device:C","desc":"Reset filter","lcsc":"C14663","mpn":"","sheet":"power","block":"mcu","pins":{"1":"NRST","2":"GND"},"wiki":"https://wiki.adom.inc/adom/cc0603-100nf"},"R103":{"value":"10k","lib":"Device:R","desc":"PA14 = SWCLK/BOOT0: keeps BOOT0 low (boot from flash)","lcsc":"C25804","mpn":"","sheet":"power","block":"mcu","pins":{"1":"SWCLK","2":"GND"},"wiki":"https://wiki.adom.inc/adom/0603waf1002t5e"},"Y101":{"value":"40MHz","lib":"Device:Crystal_GND24","desc":"40 MHz crystal, 12 pF load, 20 ohm ESR, SMD 3225 (MCU timebase)","lcsc":"C337678","mpn":"SX32Y040000BC1T001","sheet":"power","block":"mcu","pins":{"1":"HSE_IN","3":"HSE_OUT","2":"GND","4":"GND"},"wiki":"https://wiki.adom.inc/adom/sx32y040000bc1t001"},"C116":{"value":"18p","lib":"Device:C","desc":"Crystal load, C0G","lcsc":"C1647","mpn":"","sheet":"power","block":"mcu","pins":{"1":"HSE_IN","2":"GND"},"wiki":"https://wiki.adom.inc/adom/cl10c180jb8nnnc"},"C117":{"value":"18p","lib":"Device:C","desc":"Crystal load, C0G","lcsc":"C1647","mpn":"","sheet":"power","block":"mcu","pins":{"1":"HSE_OUT","2":"GND"},"wiki":"https://wiki.adom.inc/adom/cl10c180jb8nnnc"},"TP101":{"value":"VBUS","lib":"Connector:TestPoint","desc":"Debug test point (bare pad): VBUS","lcsc":"","mpn":"","sheet":"power","block":"tp","pins":{"1":"VBUS"}},"TP102":{"value":"VIN","lib":"Connector:TestPoint","desc":"Debug test point (bare pad): VIN","lcsc":"","mpn":"","sheet":"power","block":"tp","pins":{"1":"VIN"}},"TP103":{"value":"VOR","lib":"Connector:TestPoint","desc":"Debug test point (bare pad): VIN_OR","lcsc":"","mpn":"","sheet":"power","block":"tp","pins":{"1":"VIN_OR"}},"TP104":{"value":"5V","lib":"Connector:TestPoint","desc":"Debug test point (bare pad): +5V","lcsc":"","mpn":"","sheet":"power","block":"tp","pins":{"1":"+5V"}},"TP105":{"value":"3V3","lib":"Connector:TestPoint","desc":"Debug test point (bare pad): +3V3","lcsc":"","mpn":"","sheet":"power","block":"tp","pins":{"1":"+3V3"}},"TP106":{"value":"3V3A","lib":"Connector:TestPoint","desc":"Debug test point (bare pad): +3.3VA","lcsc":"","mpn":"","sheet":"power","block":"tp","pins":{"1":"+3.3VA"}},"TP107":{"value":"5VA","lib":"Connector:TestPoint","desc":"Debug test point (bare pad): +5VA","lcsc":"","mpn":"","sheet":"power","block":"tp","pins":{"1":"+5VA"}},"TP108":{"value":"GND","lib":"Connector:TestPoint","desc":"Debug test point (bare pad): GND","lcsc":"","mpn":"","sheet":"power","block":"tp","pins":{"1":"GND"}},"TP109":{"value":"GND","lib":"Connector:TestPoint","desc":"Debug test point (bare pad): GND","lcsc":"","mpn":"","sheet":"power","block":"tp","pins":{"1":"GND"}},"TP110":{"value":"CAL","lib":"Connector:TestPoint","desc":"Debug test point (bare pad): CAL_MARK","lcsc":"","mpn":"","sheet":"power","block":"tp","pins":{"1":"CAL_MARK"}},"U201":{"value":"TLV9062IDR","lib":"Amplifier_Operational:TLV9062xD","desc":"Dual 10 MHz rail-to-rail I/O op-amp","lcsc":"C398355","mpn":"TLV9062IDR","sheet":"tune","block":"vt","pins":{"3":"DAC_FM","2":"VTF_FB","1":"VTF_OUT","5":"DAC_AM","6":"VTA_FB","7":"VTA_OUT","8":"+5VA","4":"GND"},"wiki":"https://wiki.adom.inc/adom/tlv9062idr"},"R201":{"value":"10k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C25804","mpn":"","sheet":"tune","block":"vt","pins":{"1":"VTF_OUT","2":"VTF_FB"},"wiki":"https://wiki.adom.inc/adom/0603waf1002t5e"},"R202":{"value":"22k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C31850","mpn":"","sheet":"tune","block":"vt","pins":{"1":"VTF_FB","2":"GND"},"wiki":"https://wiki.adom.inc/adom/0603waf2202t5e"},"R203":{"value":"10k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C25804","mpn":"","sheet":"tune","block":"vt","pins":{"1":"VTF_OUT","2":"VTF_F1"},"wiki":"https://wiki.adom.inc/adom/0603waf1002t5e"},"C201":{"value":"4.7u","lib":"Device:C","desc":"Capacitor","lcsc":"C1779","mpn":"","sheet":"tune","block":"vt","pins":{"1":"VTF_F1","2":"GND"},"wiki":"https://wiki.adom.inc/adom/cl21a475kaqnnng"},"R204":{"value":"10k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C25804","mpn":"","sheet":"tune","block":"vt","pins":{"1":"VTF_F1","2":"VT_FM"},"wiki":"https://wiki.adom.inc/adom/0603waf1002t5e"},"C202":{"value":"1u","lib":"Device:C","desc":"Capacitor","lcsc":"C15849","mpn":"","sheet":"tune","block":"vt","pins":{"1":"VT_FM","2":"GND"},"wiki":"https://wiki.adom.inc/adom/cl10a105kb8nnnc"},"R205":{"value":"10k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C25804","mpn":"","sheet":"tune","block":"vt","pins":{"1":"VTA_OUT","2":"VTA_FB"},"wiki":"https://wiki.adom.inc/adom/0603waf1002t5e"},"R206":{"value":"22k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C31850","mpn":"","sheet":"tune","block":"vt","pins":{"1":"VTA_FB","2":"GND"},"wiki":"https://wiki.adom.inc/adom/0603waf2202t5e"},"R207":{"value":"10k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C25804","mpn":"","sheet":"tune","block":"vt","pins":{"1":"VTA_OUT","2":"VTA_F1"},"wiki":"https://wiki.adom.inc/adom/0603waf1002t5e"},"C203":{"value":"4.7u","lib":"Device:C","desc":"Capacitor","lcsc":"C1779","mpn":"","sheet":"tune","block":"vt","pins":{"1":"VTA_F1","2":"GND"},"wiki":"https://wiki.adom.inc/adom/cl21a475kaqnnng"},"R208":{"value":"10k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C25804","mpn":"","sheet":"tune","block":"vt","pins":{"1":"VTA_F1","2":"VT_AM"},"wiki":"https://wiki.adom.inc/adom/0603waf1002t5e"},"C204":{"value":"1u","lib":"Device:C","desc":"Capacitor","lcsc":"C15849","mpn":"","sheet":"tune","block":"vt","pins":{"1":"VT_AM","2":"GND"},"wiki":"https://wiki.adom.inc/adom/cl10a105kb8nnnc"},"C205":{"value":"100n","lib":"Device:C","desc":"U201 decoupling","lcsc":"C14663","mpn":"","sheet":"tune","block":"vt","pins":{"1":"+5VA","2":"GND"},"wiki":"https://wiki.adom.inc/adom/cc0603-100nf"},"R209":{"value":"10k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C25804","mpn":"","sheet":"tune","block":"pwm","pins":{"1":"PWM_RF","2":"PWM_F1"},"wiki":"https://wiki.adom.inc/adom/0603waf1002t5e"},"C206":{"value":"1u","lib":"Device:C","desc":"Capacitor","lcsc":"C15849","mpn":"","sheet":"tune","block":"pwm","pins":{"1":"PWM_F1","2":"GND"},"wiki":"https://wiki.adom.inc/adom/cl10a105kb8nnnc"},"R210":{"value":"10k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C25804","mpn":"","sheet":"tune","block":"pwm","pins":{"1":"PWM_F1","2":"PWM_F2"},"wiki":"https://wiki.adom.inc/adom/0603waf1002t5e"},"C207":{"value":"1u","lib":"Device:C","desc":"Capacitor","lcsc":"C15849","mpn":"","sheet":"tune","block":"pwm","pins":{"1":"PWM_F2","2":"GND"},"wiki":"https://wiki.adom.inc/adom/cl10a105kb8nnnc"},"U202":{"value":"TLV9062IDR","lib":"Amplifier_Operational:TLV9062xD","desc":"Dual 10 MHz rail-to-rail I/O op-amp","lcsc":"C398355","mpn":"TLV9062IDR","sheet":"tune","block":"pwm","pins":{"3":"PWM_F2","2":"VTR_FB","1":"VTR_OUT","5":"VREF_DIV","6":"VREF_BUF","7":"VREF_BUF","8":"+5VA","4":"GND"},"wiki":"https://wiki.adom.inc/adom/tlv9062idr"},"R211":{"value":"10k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C25804","mpn":"","sheet":"tune","block":"pwm","pins":{"1":"VTR_OUT","2":"VTR_FB"},"wiki":"https://wiki.adom.inc/adom/0603waf1002t5e"},"R212":{"value":"22k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C31850","mpn":"","sheet":"tune","block":"pwm","pins":{"1":"VTR_FB","2":"GND"},"wiki":"https://wiki.adom.inc/adom/0603waf2202t5e"},"R213":{"value":"1k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C21190","mpn":"","sheet":"tune","block":"pwm","pins":{"1":"VTR_OUT","2":"VT_RF"},"wiki":"https://wiki.adom.inc/adom/0603waf1001t5e"},"C208":{"value":"1u","lib":"Device:C","desc":"Capacitor","lcsc":"C15849","mpn":"","sheet":"tune","block":"pwm","pins":{"1":"VT_RF","2":"GND"},"wiki":"https://wiki.adom.inc/adom/cl10a105kb8nnnc"},"R214":{"value":"10k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C25804","mpn":"","sheet":"tune","block":"pwm","pins":{"1":"+3.3VA","2":"VREF_DIV"},"wiki":"https://wiki.adom.inc/adom/0603waf1002t5e"},"R215":{"value":"10k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C25804","mpn":"","sheet":"tune","block":"pwm","pins":{"1":"VREF_DIV","2":"GND"},"wiki":"https://wiki.adom.inc/adom/0603waf1002t5e"},"C209":{"value":"100n","lib":"Device:C","desc":"Capacitor","lcsc":"C14663","mpn":"","sheet":"tune","block":"pwm","pins":{"1":"VREF_DIV","2":"GND"},"wiki":"https://wiki.adom.inc/adom/cc0603-100nf"},"R216":{"value":"100","lib":"Device:R","desc":"Isolates op-amp from reservoir cap","lcsc":"C22775","mpn":"","sheet":"tune","block":"pwm","pins":{"1":"VREF_BUF","2":"VREF_1V65"},"wiki":"https://wiki.adom.inc/adom/0603waf1000t5e"},"C210":{"value":"1u","lib":"Device:C","desc":"Capacitor","lcsc":"C15849","mpn":"","sheet":"tune","block":"pwm","pins":{"1":"VREF_1V65","2":"GND"},"wiki":"https://wiki.adom.inc/adom/cl10a105kb8nnnc"},"C211":{"value":"100n","lib":"Device:C","desc":"U202 decoupling","lcsc":"C14663","mpn":"","sheet":"tune","block":"pwm","pins":{"1":"+5VA","2":"GND"},"wiki":"https://wiki.adom.inc/adom/cc0603-100nf"},"Q201":{"value":"MMBT3906","lib":"Transistor_BJT:MMBT3906","desc":"FM front-end power switch","lcsc":"C2143","mpn":"MMBT3906","sheet":"tune","block":"band","pins":{"1":"SWF_B","2":"+5VA","3":"+5V_FM"},"wiki":"https://wiki.adom.inc/adom/mmbt3906"},"R217":{"value":"10k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C25804","mpn":"","sheet":"tune","block":"band","pins":{"1":"+5VA","2":"SWF_B"},"wiki":"https://wiki.adom.inc/adom/0603waf1002t5e"},"R218":{"value":"1k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C21190","mpn":"","sheet":"tune","block":"band","pins":{"1":"SWF_B","2":"FM_EN_N"},"wiki":"https://wiki.adom.inc/adom/0603waf1001t5e"},"C212":{"value":"10u","lib":"Device:C","desc":"Capacitor","lcsc":"C15850","mpn":"","sheet":"tune","block":"band","pins":{"1":"+5V_FM","2":"GND"},"wiki":"https://wiki.adom.inc/adom/samsung-cl21a-x5r-0805"},"C213":{"value":"100n","lib":"Device:C","desc":"Capacitor","lcsc":"C14663","mpn":"","sheet":"tune","block":"band","pins":{"1":"+5V_FM","2":"GND"},"wiki":"https://wiki.adom.inc/adom/cc0603-100nf"},"Q202":{"value":"MMBT3906","lib":"Transistor_BJT:MMBT3906","desc":"AM front-end power switch","lcsc":"C2143","mpn":"MMBT3906","sheet":"tune","block":"band","pins":{"1":"SWA_B","2":"+5VA","3":"+5V_AM"},"wiki":"https://wiki.adom.inc/adom/mmbt3906"},"R219":{"value":"10k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C25804","mpn":"","sheet":"tune","block":"band","pins":{"1":"+5VA","2":"SWA_B"},"wiki":"https://wiki.adom.inc/adom/0603waf1002t5e"},"R220":{"value":"1k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C21190","mpn":"","sheet":"tune","block":"band","pins":{"1":"SWA_B","2":"AM_EN_N"},"wiki":"https://wiki.adom.inc/adom/0603waf1001t5e"},"C214":{"value":"10u","lib":"Device:C","desc":"Capacitor","lcsc":"C15850","mpn":"","sheet":"tune","block":"band","pins":{"1":"+5V_AM","2":"GND"},"wiki":"https://wiki.adom.inc/adom/samsung-cl21a-x5r-0805"},"C215":{"value":"100n","lib":"Device:C","desc":"Capacitor","lcsc":"C14663","mpn":"","sheet":"tune","block":"band","pins":{"1":"+5V_AM","2":"GND"},"wiki":"https://wiki.adom.inc/adom/cc0603-100nf"},"R224":{"value":"220","lib":"Device:R","desc":"Green LED has ~2.8 V Vf: small resistor from 3.3 V","lcsc":"C22962","mpn":"","sheet":"tune","block":"ui","pins":{"1":"LED_FM","2":"LEDF_A"},"wiki":"https://wiki.adom.inc/adom/uniroyal-0603waf"},"D201":{"value":"GREEN (FM)","lib":"Device:LED","desc":"FM band LED","lcsc":"C12624","mpn":"KT-0603G","sheet":"tune","block":"ui","pins":{"1":"GND","2":"LEDF_A"},"wiki":"https://wiki.adom.inc/adom/kt-0603g"},"R225":{"value":"1k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C21190","mpn":"","sheet":"tune","block":"ui","pins":{"1":"LED_AM","2":"LEDA_A"},"wiki":"https://wiki.adom.inc/adom/0603waf1001t5e"},"D202":{"value":"YELLOW (AM)","lib":"Device:LED","desc":"AM band LED","lcsc":"C2287","mpn":"KT-0603Y","sheet":"tune","block":"ui","pins":{"1":"GND","2":"LEDA_A"},"wiki":"https://wiki.adom.inc/adom/kt-0603y"},"R226":{"value":"220","lib":"Device:R","desc":"Blue LED has ~2.8 V Vf: small resistor from 3.3 V","lcsc":"C22962","mpn":"","sheet":"tune","block":"ui","pins":{"1":"LED_STAT","2":"LEDS_A"},"wiki":"https://wiki.adom.inc/adom/uniroyal-0603waf"},"D203":{"value":"BLUE (USB/stereo)","lib":"Device:LED","desc":"Status LED","lcsc":"C2288","mpn":"KT-0603B","sheet":"tune","block":"ui","pins":{"1":"GND","2":"LEDS_A"},"wiki":"https://wiki.adom.inc/barrett-land/kt-0603b"},"TP201":{"value":"DACF","lib":"Connector:TestPoint","desc":"Debug test point (bare pad): DAC_FM","lcsc":"","mpn":"","sheet":"tune","block":"tp","pins":{"1":"DAC_FM"}},"TP202":{"value":"DACA","lib":"Connector:TestPoint","desc":"Debug test point (bare pad): DAC_AM","lcsc":"","mpn":"","sheet":"tune","block":"tp","pins":{"1":"DAC_AM"}},"TP203":{"value":"PWM","lib":"Connector:TestPoint","desc":"Debug test point (bare pad): PWM_RF","lcsc":"","mpn":"","sheet":"tune","block":"tp","pins":{"1":"PWM_RF"}},"TP204":{"value":"VTF1","lib":"Connector:TestPoint","desc":"Debug test point (bare pad): VTF_OUT","lcsc":"","mpn":"","sheet":"tune","block":"tp","pins":{"1":"VTF_OUT"}},"TP205":{"value":"VTA1","lib":"Connector:TestPoint","desc":"Debug test point (bare pad): VTA_OUT","lcsc":"","mpn":"","sheet":"tune","block":"tp","pins":{"1":"VTA_OUT"}},"TP206":{"value":"VTR1","lib":"Connector:TestPoint","desc":"Debug test point (bare pad): VTR_OUT","lcsc":"","mpn":"","sheet":"tune","block":"tp","pins":{"1":"VTR_OUT"}},"TP207":{"value":"VREF","lib":"Connector:TestPoint","desc":"Debug test point (bare pad): VREF_1V65","lcsc":"","mpn":"","sheet":"tune","block":"tp","pins":{"1":"VREF_1V65"}},"TP208":{"value":"5VFM","lib":"Connector:TestPoint","desc":"Debug test point (bare pad): +5V_FM","lcsc":"","mpn":"","sheet":"tune","block":"tp","pins":{"1":"+5V_FM"}},"TP209":{"value":"5VAM","lib":"Connector:TestPoint","desc":"Debug test point (bare pad): +5V_AM","lcsc":"","mpn":"","sheet":"tune","block":"tp","pins":{"1":"+5V_AM"}},"TP210":{"value":"GND","lib":"Connector:TestPoint","desc":"Debug test point (bare pad): GND","lcsc":"","mpn":"","sheet":"tune","block":"tp","pins":{"1":"GND"}},"TP211":{"value":"GND","lib":"Connector:TestPoint","desc":"Debug test point (bare pad): GND","lcsc":"","mpn":"","sheet":"tune","block":"tp","pins":{"1":"GND"}},"J301":{"value":"ANT (SMA)","lib":"Connector:Conn_Coaxial","desc":"SMA right-angle PCB jack at the board edge (antenna)","lcsc":"C496551","mpn":"BWSMA-KWE-Z001","sheet":"fmfe","block":"ant","pins":{"1":"ANT","2":"GND"},"wiki":"https://wiki.adom.inc/adom/bwsma-kwe-z001"},"R301":{"value":"100k","lib":"Device:R","desc":"Static bleed","lcsc":"C25803","mpn":"","sheet":"fmfe","block":"ant","pins":{"1":"ANT","2":"GND"},"wiki":"https://wiki.adom.inc/adom/uniroyal-0603waf"},"R317":{"value":"47k","lib":"Device:R","desc":"Calibration marker: MCU TIM1 square wave, about -60 dBm per harmonic","lcsc":"C25819","mpn":"","sheet":"fmfe","block":"ant","pins":{"1":"CAL_MARK","2":"CAL_INJ"},"wiki":"https://wiki.adom.inc/adom/0603waf4702t5e"},"C323":{"value":"100p","lib":"Device:C","desc":"C0G, DC block; marker idles low (quiet) outside calibration","lcsc":"C14858","mpn":"","sheet":"fmfe","block":"ant","pins":{"1":"CAL_INJ","2":"ANT"},"wiki":"https://wiki.adom.inc/adom/samsung-cl10c-c0g-0603"},"L301":{"value":"2.2u","lib":"Device:L","desc":"Inductor","lcsc":"C89016","mpn":"NLV32T-2R2J-PF","sheet":"fmfe","block":"ant","pins":{"1":"ANT","2":"AMLPF_1"},"wiki":"https://wiki.adom.inc/adom/nlv32t-2r2j-pf"},"C301":{"value":"2.7n","lib":"Device:C","desc":"C0G","lcsc":"C77034","mpn":"","sheet":"fmfe","block":"ant","pins":{"1":"AMLPF_1","2":"GND"},"wiki":"https://wiki.adom.inc/adom/murata-grm18-gcm18-c0g-0603"},"L302":{"value":"8.2u","lib":"Device:L","desc":"Inductor","lcsc":"C52259800","mpn":"YSCM322522-8R2J","sheet":"fmfe","block":"ant","pins":{"1":"AMLPF_1","2":"AMLPF_2"},"wiki":"https://wiki.adom.inc/adom/yscm322522-8r2j"},"C302":{"value":"2.7n","lib":"Device:C","desc":"C0G","lcsc":"C77034","mpn":"","sheet":"fmfe","block":"ant","pins":{"1":"AMLPF_2","2":"GND"},"wiki":"https://wiki.adom.inc/adom/murata-grm18-gcm18-c0g-0603"},"L303":{"value":"2.2u","lib":"Device:L","desc":"Inductor","lcsc":"C89016","mpn":"NLV32T-2R2J-PF","sheet":"fmfe","block":"ant","pins":{"1":"AMLPF_2","2":"AM_RFIN"},"wiki":"https://wiki.adom.inc/adom/nlv32t-2r2j-pf"},"C303":{"value":"47p","lib":"Device:C","desc":"C0G","lcsc":"C1671","mpn":"","sheet":"fmfe","block":"ant","pins":{"1":"ANT","2":"FMHP_1"},"wiki":"https://wiki.adom.inc/adom/samsung-cl10c-c0g-0603"},"L304":{"value":"56n","lib":"Device:L","desc":"Wire-wound, Q>30 @100 MHz","lcsc":"C98079","mpn":"LQW18AN56NG00D","sheet":"fmfe","block":"ant","pins":{"1":"FMHP_1","2":"GND"},"wiki":"https://wiki.adom.inc/adom/murata-lqw18an"},"C304":{"value":"47p","lib":"Device:C","desc":"C0G","lcsc":"C1671","mpn":"","sheet":"fmfe","block":"ant","pins":{"1":"FMHP_1","2":"FMHP_2"},"wiki":"https://wiki.adom.inc/adom/samsung-cl10c-c0g-0603"},"C305":{"value":"22p","lib":"Device:C","desc":"C0G","lcsc":"C1653","mpn":"","sheet":"fmfe","block":"ant","pins":{"1":"FMHP_2","2":"GND"},"wiki":"https://wiki.adom.inc/adom/samsung-cl10c-c0g-0603"},"L305":{"value":"120n","lib":"Device:L","desc":"Wire-wound","lcsc":"C86138","mpn":"LQW18ANR12G00D","sheet":"fmfe","block":"ant","pins":{"1":"FMHP_2","2":"FM_BPF"},"wiki":"https://wiki.adom.inc/adom/murata-lqw18an"},"C306":{"value":"22p","lib":"Device:C","desc":"C0G","lcsc":"C1653","mpn":"","sheet":"fmfe","block":"ant","pins":{"1":"FM_BPF","2":"GND"},"wiki":"https://wiki.adom.inc/adom/samsung-cl10c-c0g-0603"},"R302":{"value":"56","lib":"Device:R","desc":"Filter termination","lcsc":"C25196","mpn":"","sheet":"fmfe","block":"fmrf","pins":{"1":"FM_BPF","2":"GND"},"wiki":"https://wiki.adom.inc/adom/uniroyal-0603waf"},"C307":{"value":"1n","lib":"Device:C","desc":"Capacitor","lcsc":"C1588","mpn":"","sheet":"fmfe","block":"fmrf","pins":{"1":"FM_BPF","2":"FMRF_B"},"wiki":"https://wiki.adom.inc/adom/cl10b102kb8nnnc"},"Q301":{"value":"MMBTH10","lib":"Transistor_BJT:MMBT3904","desc":"FM RF amplifier","lcsc":"C545531","mpn":"MMBTH10","sheet":"fmfe","block":"fmrf","pins":{"1":"FMRF_B","2":"FMRF_E","3":"FMRF_C"},"wiki":"https://wiki.adom.inc/adom/mmbth10"},"R303":{"value":"4.7k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C23162","mpn":"","sheet":"fmfe","block":"fmrf","pins":{"1":"V_RF1","2":"FMRF_B"},"wiki":"https://wiki.adom.inc/adom/0603waf4701t5e"},"R304":{"value":"1.8k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C4177","mpn":"","sheet":"fmfe","block":"fmrf","pins":{"1":"FMRF_B","2":"GND"},"wiki":"https://wiki.adom.inc/adom/uniroyal-0603waf"},"R305":{"value":"22","lib":"Device:R","desc":"Unbypassed degeneration","lcsc":"C23345","mpn":"","sheet":"fmfe","block":"fmrf","pins":{"1":"FMRF_E","2":"FMRF_E2"},"wiki":"https://wiki.adom.inc/adom/0603waf220jt5e"},"R306":{"value":"82","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C23255","mpn":"","sheet":"fmfe","block":"fmrf","pins":{"1":"FMRF_E2","2":"GND"},"wiki":"https://wiki.adom.inc/adom/uniroyal-0603waf"},"C308":{"value":"1n","lib":"Device:C","desc":"Capacitor","lcsc":"C1588","mpn":"","sheet":"fmfe","block":"fmrf","pins":{"1":"FMRF_E2","2":"GND"},"wiki":"https://wiki.adom.inc/adom/cl10b102kb8nnnc"},"L306":{"value":"150n","lib":"Device:L","desc":"Tank inductor, wire-wound","lcsc":"C113131","mpn":"LQW18ANR15G00D","sheet":"fmfe","block":"fmrf","pins":{"1":"FMRF_C","2":"V_RF1"},"wiki":"https://wiki.adom.inc/adom/murata-lqw18an"},"C309":{"value":"3.3p","lib":"Device:C","desc":"C0G","lcsc":"C282249","mpn":"","sheet":"fmfe","block":"fmrf","pins":{"1":"FMRF_C","2":"GND"},"wiki":"https://wiki.adom.inc/adom/yageo-cc0603-npo"},"C310":{"value":"22p","lib":"Device:C","desc":"C0G, varactor series cap","lcsc":"C1653","mpn":"","sheet":"fmfe","block":"fmrf","pins":{"1":"FMRF_C","2":"VAR_RF"},"wiki":"https://wiki.adom.inc/adom/samsung-cl10c-c0g-0603"},"D301":{"value":"BB910","lib":"Device:D_Capacitance","desc":"Low-voltage tuning varactor, 45 pF @ 0.5 V, C0.5/C5 = 5","lcsc":"C475628","mpn":"BB910","sheet":"fmfe","block":"fmrf","pins":{"1":"VAR_RF","2":"GND"},"wiki":"https://wiki.adom.inc/adom/bb910"},"R307":{"value":"100k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C25803","mpn":"","sheet":"fmfe","block":"fmrf","pins":{"1":"VT_RF","2":"VAR_RF"},"wiki":"https://wiki.adom.inc/adom/uniroyal-0603waf"},"R308":{"value":"47","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C23182","mpn":"","sheet":"fmfe","block":"fmrf","pins":{"1":"+5V_FM","2":"V_RF1"},"wiki":"https://wiki.adom.inc/adom/0603waf470jt5e"},"C311":{"value":"100n","lib":"Device:C","desc":"Capacitor","lcsc":"C14663","mpn":"","sheet":"fmfe","block":"fmrf","pins":{"1":"V_RF1","2":"GND"},"wiki":"https://wiki.adom.inc/adom/cc0603-100nf"},"C312":{"value":"1n","lib":"Device:C","desc":"Capacitor","lcsc":"C1588","mpn":"","sheet":"fmfe","block":"fmrf","pins":{"1":"V_RF1","2":"GND"},"wiki":"https://wiki.adom.inc/adom/cl10b102kb8nnnc"},"C313":{"value":"4.7p","lib":"Device:C","desc":"C0G, tank tap to mixer","lcsc":"C1669","mpn":"","sheet":"fmfe","block":"fmrf","pins":{"1":"FMRF_C","2":"FM_MIX_B"},"wiki":"https://wiki.adom.inc/adom/fenghua-0603-mlcc"},"Q302":{"value":"MMBTH10","lib":"Transistor_BJT:MMBT3904","desc":"FM VCO","lcsc":"C545531","mpn":"MMBTH10","sheet":"fmfe","block":"fmlo","pins":{"1":"FMLO_B","2":"FMLO_E","3":"FMLO_C"},"wiki":"https://wiki.adom.inc/adom/mmbth10"},"R309":{"value":"47","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C23182","mpn":"","sheet":"fmfe","block":"fmlo","pins":{"1":"+5V_FM","2":"V_LO1"},"wiki":"https://wiki.adom.inc/adom/0603waf470jt5e"},"C314":{"value":"100n","lib":"Device:C","desc":"Capacitor","lcsc":"C14663","mpn":"","sheet":"fmfe","block":"fmlo","pins":{"1":"V_LO1","2":"GND"},"wiki":"https://wiki.adom.inc/adom/cc0603-100nf"},"C315":{"value":"1n","lib":"Device:C","desc":"Capacitor","lcsc":"C1588","mpn":"","sheet":"fmfe","block":"fmlo","pins":{"1":"V_LO1","2":"GND"},"wiki":"https://wiki.adom.inc/adom/cl10b102kb8nnnc"},"R310":{"value":"10k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C25804","mpn":"","sheet":"fmfe","block":"fmlo","pins":{"1":"V_LO1","2":"FMLO_B"},"wiki":"https://wiki.adom.inc/adom/0603waf1002t5e"},"R311":{"value":"4.7k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C23162","mpn":"","sheet":"fmfe","block":"fmlo","pins":{"1":"FMLO_B","2":"GND"},"wiki":"https://wiki.adom.inc/adom/0603waf4701t5e"},"C316":{"value":"1n","lib":"Device:C","desc":"Base AC ground","lcsc":"C1588","mpn":"","sheet":"fmfe","block":"fmlo","pins":{"1":"FMLO_B","2":"GND"},"wiki":"https://wiki.adom.inc/adom/cl10b102kb8nnnc"},"R312":{"value":"330","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C23138","mpn":"","sheet":"fmfe","block":"fmlo","pins":{"1":"FMLO_E","2":"GND"},"wiki":"https://wiki.adom.inc/adom/0603waf3300t5e"},"C317":{"value":"15p","lib":"Device:C","desc":"C0G","lcsc":"C1644","mpn":"","sheet":"fmfe","block":"fmlo","pins":{"1":"FMLO_E","2":"GND"},"wiki":"https://wiki.adom.inc/adom/samsung-cl10c-c0g-0603"},"C318":{"value":"4.7p","lib":"Device:C","desc":"C0G feedback","lcsc":"C1669","mpn":"","sheet":"fmfe","block":"fmlo","pins":{"1":"FMLO_C","2":"FMLO_E"},"wiki":"https://wiki.adom.inc/adom/fenghua-0603-mlcc"},"L307":{"value":"110n","lib":"Device:L","desc":"Tank inductor, wire-wound","lcsc":"C113130","mpn":"LQW18ANR11G00D","sheet":"fmfe","block":"fmlo","pins":{"1":"FMLO_C","2":"V_LO1"},"wiki":"https://wiki.adom.inc/adom/murata-lqw18an"},"C319":{"value":"3.3p","lib":"Device:C","desc":"C0G","lcsc":"C282249","mpn":"","sheet":"fmfe","block":"fmlo","pins":{"1":"FMLO_C","2":"GND"},"wiki":"https://wiki.adom.inc/adom/yageo-cc0603-npo"},"C320":{"value":"22p","lib":"Device:C","desc":"C0G, varactor series cap","lcsc":"C1653","mpn":"","sheet":"fmfe","block":"fmlo","pins":{"1":"FMLO_C","2":"VAR_LO"},"wiki":"https://wiki.adom.inc/adom/samsung-cl10c-c0g-0603"},"D302":{"value":"BB910","lib":"Device:D_Capacitance","desc":"Low-voltage tuning varactor, 45 pF @ 0.5 V, C0.5/C5 = 5","lcsc":"C475628","mpn":"BB910","sheet":"fmfe","block":"fmlo","pins":{"1":"VAR_LO","2":"GND"},"wiki":"https://wiki.adom.inc/adom/bb910"},"R313":{"value":"100k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C25803","mpn":"","sheet":"fmfe","block":"fmlo","pins":{"1":"VT_FM","2":"VAR_LO"},"wiki":"https://wiki.adom.inc/adom/uniroyal-0603waf"},"C321":{"value":"2.2p","lib":"Device:C","desc":"C0G, LO injection","lcsc":"C1651","mpn":"","sheet":"fmfe","block":"fmlo","pins":{"1":"FMLO_C","2":"FM_MIX_B"},"wiki":"https://wiki.adom.inc/adom/fenghua-0603-mlcc"},"Q303":{"value":"MMBTH10","lib":"Transistor_BJT:MMBT3904","desc":"FM mixer","lcsc":"C545531","mpn":"MMBTH10","sheet":"fmfe","block":"fmmix","pins":{"1":"FM_MIX_B","2":"FMMIX_E","3":"IF_MIX"},"wiki":"https://wiki.adom.inc/adom/mmbth10"},"R314":{"value":"22k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C31850","mpn":"","sheet":"fmfe","block":"fmmix","pins":{"1":"+5V_FM","2":"FM_MIX_B"},"wiki":"https://wiki.adom.inc/adom/0603waf2202t5e"},"R315":{"value":"6.8k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C23212","mpn":"","sheet":"fmfe","block":"fmmix","pins":{"1":"FM_MIX_B","2":"GND"},"wiki":"https://wiki.adom.inc/adom/0603waf6801t5e"},"R316":{"value":"150","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C22808","mpn":"","sheet":"fmfe","block":"fmmix","pins":{"1":"FMMIX_E","2":"GND"},"wiki":"https://wiki.adom.inc/adom/uniroyal-0603waf"},"C322":{"value":"10n","lib":"Device:C","desc":"Capacitor","lcsc":"C57112","mpn":"","sheet":"fmfe","block":"fmmix","pins":{"1":"FMMIX_E","2":"GND"},"wiki":"https://wiki.adom.inc/adom/fenghua-0603-mlcc"},"TP301":{"value":"VRF","lib":"Connector:TestPoint","desc":"Debug test point (bare pad): V_RF1","lcsc":"","mpn":"","sheet":"fmfe","block":"tp","pins":{"1":"V_RF1"}},"TP302":{"value":"VLO","lib":"Connector:TestPoint","desc":"Debug test point (bare pad): V_LO1","lcsc":"","mpn":"","sheet":"fmfe","block":"tp","pins":{"1":"V_LO1"}},"TP303":{"value":"FLO","lib":"Connector:TestPoint","desc":"Debug test point (bare pad): FMLO_E","lcsc":"","mpn":"","sheet":"fmfe","block":"tp","pins":{"1":"FMLO_E"}},"TP304":{"value":"MIX","lib":"Connector:TestPoint","desc":"Debug test point (bare pad): IF_MIX","lcsc":"","mpn":"","sheet":"fmfe","block":"tp","pins":{"1":"IF_MIX"}},"TP305":{"value":"GND","lib":"Connector:TestPoint","desc":"Debug test point (bare pad): GND","lcsc":"","mpn":"","sheet":"fmfe","block":"tp","pins":{"1":"GND"}},"R401":{"value":"51","lib":"Device:R","desc":"LPF termination","lcsc":"C23197","mpn":"","sheet":"amfe","block":"amrf","pins":{"1":"AM_RFIN","2":"GND"},"wiki":"https://wiki.adom.inc/adom/uniroyal-0603waf"},"C401":{"value":"100n","lib":"Device:C","desc":"Capacitor","lcsc":"C14663","mpn":"","sheet":"amfe","block":"amrf","pins":{"1":"AM_RFIN","2":"AMRF_B"},"wiki":"https://wiki.adom.inc/adom/cc0603-100nf"},"Q401":{"value":"MMBT3904","lib":"Transistor_BJT:MMBT3904","desc":"AM RF preamp","lcsc":"C20526","mpn":"MMBT3904","sheet":"amfe","block":"amrf","pins":{"1":"AMRF_B","2":"AMRF_E","3":"AMRF_C"},"wiki":"https://wiki.adom.inc/adom/mmbt3904"},"R402":{"value":"47","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C23182","mpn":"","sheet":"amfe","block":"amrf","pins":{"1":"+5V_AM","2":"V_AM1"},"wiki":"https://wiki.adom.inc/adom/0603waf470jt5e"},"C402":{"value":"10u","lib":"Device:C","desc":"Capacitor","lcsc":"C15850","mpn":"","sheet":"amfe","block":"amrf","pins":{"1":"V_AM1","2":"GND"},"wiki":"https://wiki.adom.inc/adom/samsung-cl21a-x5r-0805"},"C403":{"value":"100n","lib":"Device:C","desc":"Capacitor","lcsc":"C14663","mpn":"","sheet":"amfe","block":"amrf","pins":{"1":"V_AM1","2":"GND"},"wiki":"https://wiki.adom.inc/adom/cc0603-100nf"},"R403":{"value":"22k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C31850","mpn":"","sheet":"amfe","block":"amrf","pins":{"1":"V_AM1","2":"AMRF_B"},"wiki":"https://wiki.adom.inc/adom/0603waf2202t5e"},"R404":{"value":"6.8k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C23212","mpn":"","sheet":"amfe","block":"amrf","pins":{"1":"AMRF_B","2":"GND"},"wiki":"https://wiki.adom.inc/adom/0603waf6801t5e"},"R405":{"value":"22","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C23345","mpn":"","sheet":"amfe","block":"amrf","pins":{"1":"AMRF_E","2":"AMRF_E2"},"wiki":"https://wiki.adom.inc/adom/0603waf220jt5e"},"R406":{"value":"56","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C25196","mpn":"","sheet":"amfe","block":"amrf","pins":{"1":"AMRF_E2","2":"GND"},"wiki":"https://wiki.adom.inc/adom/uniroyal-0603waf"},"C404":{"value":"100n","lib":"Device:C","desc":"Capacitor","lcsc":"C14663","mpn":"","sheet":"amfe","block":"amrf","pins":{"1":"AMRF_E2","2":"GND"},"wiki":"https://wiki.adom.inc/adom/cc0603-100nf"},"R407":{"value":"470","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C23179","mpn":"","sheet":"amfe","block":"amrf","pins":{"1":"V_AM1","2":"AMRF_C"},"wiki":"https://wiki.adom.inc/adom/0603waf4700t5e"},"C405":{"value":"100n","lib":"Device:C","desc":"Capacitor","lcsc":"C14663","mpn":"","sheet":"amfe","block":"amrf","pins":{"1":"AMRF_C","2":"AM_MIX_B"},"wiki":"https://wiki.adom.inc/adom/cc0603-100nf"},"Q402":{"value":"MMBT3904","lib":"Transistor_BJT:MMBT3904","desc":"AM VCO","lcsc":"C20526","mpn":"MMBT3904","sheet":"amfe","block":"amlo","pins":{"1":"AMLO_B","2":"AMLO_E","3":"V_AM2"},"wiki":"https://wiki.adom.inc/adom/mmbt3904"},"R408":{"value":"47","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C23182","mpn":"","sheet":"amfe","block":"amlo","pins":{"1":"+5V_AM","2":"V_AM2"},"wiki":"https://wiki.adom.inc/adom/0603waf470jt5e"},"C406":{"value":"10u","lib":"Device:C","desc":"Capacitor","lcsc":"C15850","mpn":"","sheet":"amfe","block":"amlo","pins":{"1":"V_AM2","2":"GND"},"wiki":"https://wiki.adom.inc/adom/samsung-cl21a-x5r-0805"},"C407":{"value":"100n","lib":"Device:C","desc":"Capacitor","lcsc":"C14663","mpn":"","sheet":"amfe","block":"amlo","pins":{"1":"V_AM2","2":"GND"},"wiki":"https://wiki.adom.inc/adom/cc0603-100nf"},"R409":{"value":"22k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C31850","mpn":"","sheet":"amfe","block":"amlo","pins":{"1":"V_AM2","2":"AMLO_B"},"wiki":"https://wiki.adom.inc/adom/0603waf2202t5e"},"R410":{"value":"22k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C31850","mpn":"","sheet":"amfe","block":"amlo","pins":{"1":"AMLO_B","2":"GND"},"wiki":"https://wiki.adom.inc/adom/0603waf2202t5e"},"R411":{"value":"1.5k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C22843","mpn":"","sheet":"amfe","block":"amlo","pins":{"1":"AMLO_E","2":"GND"},"wiki":"https://wiki.adom.inc/adom/uniroyal-0603waf"},"C408":{"value":"220p","lib":"Device:C","desc":"C0G","lcsc":"C388907","mpn":"","sheet":"amfe","block":"amlo","pins":{"1":"AMLO_B","2":"AMLO_E"},"wiki":"https://wiki.adom.inc/adom/murata-grm18-gcm18-c0g-0603"},"C409":{"value":"470p","lib":"Device:C","desc":"C0G","lcsc":"C106211","mpn":"","sheet":"amfe","block":"amlo","pins":{"1":"AMLO_E","2":"GND"},"wiki":"https://wiki.adom.inc/adom/yageo-cc0603-npo"},"L401":{"value":"8.2u","lib":"Device:L","desc":"High-Q wire-wound","lcsc":"C52259800","mpn":"YSCM322522-8R2J","sheet":"amfe","block":"amlo","pins":{"1":"AMLO_B","2":"AMLO_T"},"wiki":"https://wiki.adom.inc/adom/yscm322522-8r2j"},"C410":{"value":"15p","lib":"Device:C","desc":"C0G","lcsc":"C1644","mpn":"","sheet":"amfe","block":"amlo","pins":{"1":"AMLO_T","2":"GND"},"wiki":"https://wiki.adom.inc/adom/samsung-cl10c-c0g-0603"},"C411":{"value":"33p","lib":"Device:C","desc":"C0G, varactor series cap","lcsc":"C1663","mpn":"","sheet":"amfe","block":"amlo","pins":{"1":"AMLO_T","2":"VAR_AM"},"wiki":"https://wiki.adom.inc/adom/samsung-cl10c-c0g-0603"},"D401":{"value":"BB910","lib":"Device:D_Capacitance","desc":"Low-voltage tuning varactor, 45 pF @ 0.5 V, C0.5/C5 = 5","lcsc":"C475628","mpn":"BB910","sheet":"amfe","block":"amlo","pins":{"1":"VAR_AM","2":"GND"},"wiki":"https://wiki.adom.inc/adom/bb910"},"R412":{"value":"100k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C25803","mpn":"","sheet":"amfe","block":"amlo","pins":{"1":"VT_AM","2":"VAR_AM"},"wiki":"https://wiki.adom.inc/adom/uniroyal-0603waf"},"C412":{"value":"47p","lib":"Device:C","desc":"C0G, LO injection","lcsc":"C1671","mpn":"","sheet":"amfe","block":"amlo","pins":{"1":"AMLO_E","2":"AM_MIX_B"},"wiki":"https://wiki.adom.inc/adom/samsung-cl10c-c0g-0603"},"Q403":{"value":"MMBT3904","lib":"Transistor_BJT:MMBT3904","desc":"AM mixer","lcsc":"C20526","mpn":"MMBT3904","sheet":"amfe","block":"ammix","pins":{"1":"AM_MIX_B","2":"AMMIX_E","3":"IF_MIX"},"wiki":"https://wiki.adom.inc/adom/mmbt3904"},"R413":{"value":"22k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C31850","mpn":"","sheet":"amfe","block":"ammix","pins":{"1":"+5V_AM","2":"AM_MIX_B"},"wiki":"https://wiki.adom.inc/adom/0603waf2202t5e"},"R414":{"value":"6.8k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C23212","mpn":"","sheet":"amfe","block":"ammix","pins":{"1":"AM_MIX_B","2":"GND"},"wiki":"https://wiki.adom.inc/adom/0603waf6801t5e"},"R415":{"value":"150","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C22808","mpn":"","sheet":"amfe","block":"ammix","pins":{"1":"AMMIX_E","2":"GND"},"wiki":"https://wiki.adom.inc/adom/uniroyal-0603waf"},"C413":{"value":"100n","lib":"Device:C","desc":"Capacitor","lcsc":"C14663","mpn":"","sheet":"amfe","block":"ammix","pins":{"1":"AMMIX_E","2":"GND"},"wiki":"https://wiki.adom.inc/adom/cc0603-100nf"},"TP401":{"value":"VAM1","lib":"Connector:TestPoint","desc":"Debug test point (bare pad): V_AM1","lcsc":"","mpn":"","sheet":"amfe","block":"tp","pins":{"1":"V_AM1"}},"TP402":{"value":"VAM2","lib":"Connector:TestPoint","desc":"Debug test point (bare pad): V_AM2","lcsc":"","mpn":"","sheet":"amfe","block":"tp","pins":{"1":"V_AM2"}},"TP403":{"value":"AMIN","lib":"Connector:TestPoint","desc":"Debug test point (bare pad): AM_RFIN","lcsc":"","mpn":"","sheet":"amfe","block":"tp","pins":{"1":"AM_RFIN"}},"TP404":{"value":"ARF","lib":"Connector:TestPoint","desc":"Debug test point (bare pad): AMRF_C","lcsc":"","mpn":"","sheet":"amfe","block":"tp","pins":{"1":"AMRF_C"}},"TP405":{"value":"ALO","lib":"Connector:TestPoint","desc":"Debug test point (bare pad): AMLO_E","lcsc":"","mpn":"","sheet":"amfe","block":"tp","pins":{"1":"AMLO_E"}},"TP406":{"value":"GND","lib":"Connector:TestPoint","desc":"Debug test point (bare pad): GND","lcsc":"","mpn":"","sheet":"amfe","block":"tp","pins":{"1":"GND"}},"R501":{"value":"330","lib":"Device:R","desc":"Mixer load = filter source impedance","lcsc":"C23138","mpn":"","sheet":"if","block":"cf1","pins":{"1":"V_IF1","2":"IF_MIX"},"wiki":"https://wiki.adom.inc/adom/0603waf3300t5e"},"C501":{"value":"10n","lib":"Device:C","desc":"Capacitor","lcsc":"C57112","mpn":"","sheet":"if","block":"cf1","pins":{"1":"IF_MIX","2":"CF1_IN"},"wiki":"https://wiki.adom.inc/adom/fenghua-0603-mlcc"},"C502":{"value":"22p","lib":"Device:C","desc":"Shunts VHF LO feed-through","lcsc":"C1653","mpn":"","sheet":"if","block":"cf1","pins":{"1":"IF_MIX","2":"GND"},"wiki":"https://wiki.adom.inc/adom/samsung-cl10c-c0g-0603"},"FL501":{"value":"HCCF3-10.700-LTCVS3L","lib":"AMFM:CeramicFilter_3pin","desc":"10.7 MHz SMD ceramic filter, 180 kHz BW, 330 ohm","lcsc":"C19191232","mpn":"HCCF3-10.700-LTCVS3L","sheet":"if","block":"cf1","pins":{"1":"CF1_IN","2":"GND","3":"CF1_OUT"},"wiki":"https://wiki.adom.inc/adom/hccf3-10-700-ltcvs3l"},"R502":{"value":"22","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C23345","mpn":"","sheet":"if","block":"cf1","pins":{"1":"+5VA","2":"V_IF1"},"wiki":"https://wiki.adom.inc/adom/0603waf220jt5e"},"C503":{"value":"10u","lib":"Device:C","desc":"Capacitor","lcsc":"C15850","mpn":"","sheet":"if","block":"cf1","pins":{"1":"V_IF1","2":"GND"},"wiki":"https://wiki.adom.inc/adom/samsung-cl21a-x5r-0805"},"C504":{"value":"100n","lib":"Device:C","desc":"Capacitor","lcsc":"C14663","mpn":"","sheet":"if","block":"cf1","pins":{"1":"V_IF1","2":"GND"},"wiki":"https://wiki.adom.inc/adom/cc0603-100nf"},"R503":{"value":"330","lib":"Device:R","desc":"Filter termination","lcsc":"C23138","mpn":"","sheet":"if","block":"cf1","pins":{"1":"CF1_OUT","2":"GND"},"wiki":"https://wiki.adom.inc/adom/0603waf3300t5e"},"C505":{"value":"10n","lib":"Device:C","desc":"Capacitor","lcsc":"C57112","mpn":"","sheet":"if","block":"cf1","pins":{"1":"CF1_OUT","2":"IF_B1"},"wiki":"https://wiki.adom.inc/adom/fenghua-0603-mlcc"},"Q501":{"value":"MMBT3904","lib":"Transistor_BJT:MMBT3904","desc":"10.7 MHz IF amplifier","lcsc":"C20526","mpn":"MMBT3904","sheet":"if","block":"ifamp","pins":{"1":"IF_B1","2":"IF_E1","3":"IF_C1"},"wiki":"https://wiki.adom.inc/adom/mmbt3904"},"R504":{"value":"15k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C22809","mpn":"","sheet":"if","block":"ifamp","pins":{"1":"V_IF1","2":"IF_B1"},"wiki":"https://wiki.adom.inc/adom/uniroyal-0603waf"},"R505":{"value":"5.6k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C23189","mpn":"","sheet":"if","block":"ifamp","pins":{"1":"IF_B1","2":"GND"},"wiki":"https://wiki.adom.inc/adom/uniroyal-0603waf"},"R506":{"value":"22","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C23345","mpn":"","sheet":"if","block":"ifamp","pins":{"1":"IF_E1","2":"IF_E2"},"wiki":"https://wiki.adom.inc/adom/0603waf220jt5e"},"R507":{"value":"120","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C22787","mpn":"","sheet":"if","block":"ifamp","pins":{"1":"IF_E2","2":"GND"},"wiki":"https://wiki.adom.inc/adom/uniroyal-0603waf"},"C506":{"value":"100n","lib":"Device:C","desc":"Capacitor","lcsc":"C14663","mpn":"","sheet":"if","block":"ifamp","pins":{"1":"IF_E2","2":"GND"},"wiki":"https://wiki.adom.inc/adom/cc0603-100nf"},"R508":{"value":"330","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C23138","mpn":"","sheet":"if","block":"ifamp","pins":{"1":"V_IF1","2":"IF_C1"},"wiki":"https://wiki.adom.inc/adom/0603waf3300t5e"},"C507":{"value":"10n","lib":"Device:C","desc":"Capacitor","lcsc":"C57112","mpn":"","sheet":"if","block":"ifamp","pins":{"1":"IF_C1","2":"CF2_IN"},"wiki":"https://wiki.adom.inc/adom/fenghua-0603-mlcc"},"FL502":{"value":"HCCF3-10.700-LTCVS3L","lib":"AMFM:CeramicFilter_3pin","desc":"10.7 MHz SMD ceramic filter, 180 kHz BW, 330 ohm","lcsc":"C19191232","mpn":"HCCF3-10.700-LTCVS3L","sheet":"if","block":"ifamp","pins":{"1":"CF2_IN","2":"GND","3":"CF2_OUT"},"wiki":"https://wiki.adom.inc/adom/hccf3-10-700-ltcvs3l"},"R509":{"value":"330","lib":"Device:R","desc":"Filter termination","lcsc":"C23138","mpn":"","sheet":"if","block":"ifamp","pins":{"1":"CF2_OUT","2":"GND"},"wiki":"https://wiki.adom.inc/adom/0603waf3300t5e"},"C508":{"value":"10n","lib":"Device:C","desc":"Capacitor","lcsc":"C57112","mpn":"","sheet":"if","block":"ifamp","pins":{"1":"CF2_OUT","2":"MIX2_B"},"wiki":"https://wiki.adom.inc/adom/fenghua-0603-mlcc"},"Q502":{"value":"MMBT3904","lib":"Transistor_BJT:MMBT3904","desc":"2nd mixer","lcsc":"C20526","mpn":"MMBT3904","sheet":"if","block":"mix2","pins":{"1":"MIX2_B","2":"MIX2_E","3":"IF2_OUT"},"wiki":"https://wiki.adom.inc/adom/mmbt3904"},"R510":{"value":"22k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C31850","mpn":"","sheet":"if","block":"mix2","pins":{"1":"V_IF2","2":"MIX2_B"},"wiki":"https://wiki.adom.inc/adom/0603waf2202t5e"},"R511":{"value":"6.8k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C23212","mpn":"","sheet":"if","block":"mix2","pins":{"1":"MIX2_B","2":"GND"},"wiki":"https://wiki.adom.inc/adom/0603waf6801t5e"},"R512":{"value":"220","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C22962","mpn":"","sheet":"if","block":"mix2","pins":{"1":"MIX2_E","2":"GND"},"wiki":"https://wiki.adom.inc/adom/uniroyal-0603waf"},"C510":{"value":"100n","lib":"Device:C","desc":"Capacitor","lcsc":"C14663","mpn":"","sheet":"if","block":"mix2","pins":{"1":"MIX2_E","2":"GND"},"wiki":"https://wiki.adom.inc/adom/cc0603-100nf"},"R513":{"value":"1.5k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C22843","mpn":"","sheet":"if","block":"mix2","pins":{"1":"V_IF2","2":"IF2_OUT"},"wiki":"https://wiki.adom.inc/adom/uniroyal-0603waf"},"C511":{"value":"100p","lib":"Device:C","desc":"Rolls off 10 MHz LO feed-through","lcsc":"C14858","mpn":"","sheet":"if","block":"mix2","pins":{"1":"IF2_OUT","2":"GND"},"wiki":"https://wiki.adom.inc/adom/samsung-cl10c-c0g-0603"},"R514":{"value":"22","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C23345","mpn":"","sheet":"if","block":"mix2","pins":{"1":"+5VA","2":"V_IF2"},"wiki":"https://wiki.adom.inc/adom/0603waf220jt5e"},"C512":{"value":"10u","lib":"Device:C","desc":"Capacitor","lcsc":"C15850","mpn":"","sheet":"if","block":"mix2","pins":{"1":"V_IF2","2":"GND"},"wiki":"https://wiki.adom.inc/adom/samsung-cl21a-x5r-0805"},"C513":{"value":"100n","lib":"Device:C","desc":"Capacitor","lcsc":"C14663","mpn":"","sheet":"if","block":"mix2","pins":{"1":"V_IF2","2":"GND"},"wiki":"https://wiki.adom.inc/adom/cc0603-100nf"},"Q503":{"value":"MMBT3904","lib":"Transistor_BJT:MMBT3904","desc":"Crystal oscillator","lcsc":"C20526","mpn":"MMBT3904","sheet":"if","block":"xo","pins":{"1":"XO_B","2":"XO_E","3":"V_IF2"},"wiki":"https://wiki.adom.inc/adom/mmbt3904"},"R515":{"value":"47k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C25819","mpn":"","sheet":"if","block":"xo","pins":{"1":"V_IF2","2":"XO_B"},"wiki":"https://wiki.adom.inc/adom/0603waf4702t5e"},"R516":{"value":"47k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C25819","mpn":"","sheet":"if","block":"xo","pins":{"1":"XO_B","2":"GND"},"wiki":"https://wiki.adom.inc/adom/0603waf4702t5e"},"R517":{"value":"1.5k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C22843","mpn":"","sheet":"if","block":"xo","pins":{"1":"XO_E","2":"GND"},"wiki":"https://wiki.adom.inc/adom/uniroyal-0603waf"},"C514":{"value":"100p","lib":"Device:C","desc":"C0G","lcsc":"C14858","mpn":"","sheet":"if","block":"xo","pins":{"1":"XO_B","2":"XO_E"},"wiki":"https://wiki.adom.inc/adom/samsung-cl10c-c0g-0603"},"C515":{"value":"220p","lib":"Device:C","desc":"C0G","lcsc":"C388907","mpn":"","sheet":"if","block":"xo","pins":{"1":"XO_E","2":"GND"},"wiki":"https://wiki.adom.inc/adom/murata-grm18-gcm18-c0g-0603"},"Y501":{"value":"10.24MHz","lib":"Device:Crystal_GND24","desc":"10.240 MHz crystal, 12 pF load, SMD 3225","lcsc":"C51822681","mpn":"0132M4-10.240F12DZNG","sheet":"if","block":"xo","pins":{"1":"XO_B","3":"XO_X","2":"GND","4":"GND"},"wiki":"https://wiki.adom.inc/adom/0132m4-10-240f12dzng"},"C516":{"value":"15p","lib":"Device:C","desc":"C0G, crystal load trim (12 pF crystal)","lcsc":"C1644","mpn":"","sheet":"if","block":"xo","pins":{"1":"XO_X","2":"GND"},"wiki":"https://wiki.adom.inc/adom/samsung-cl10c-c0g-0603"},"C509":{"value":"22p","lib":"Device:C","desc":"C0G, LO injection","lcsc":"C1653","mpn":"","sheet":"if","block":"xo","pins":{"1":"XO_E","2":"MIX2_B"},"wiki":"https://wiki.adom.inc/adom/samsung-cl10c-c0g-0603"},"TP501":{"value":"VIF1","lib":"Connector:TestPoint","desc":"Debug test point (bare pad): V_IF1","lcsc":"","mpn":"","sheet":"if","block":"tp","pins":{"1":"V_IF1"}},"TP502":{"value":"VIF2","lib":"Connector:TestPoint","desc":"Debug test point (bare pad): V_IF2","lcsc":"","mpn":"","sheet":"if","block":"tp","pins":{"1":"V_IF2"}},"TP503":{"value":"CF1","lib":"Connector:TestPoint","desc":"Debug test point (bare pad): CF1_OUT","lcsc":"","mpn":"","sheet":"if","block":"tp","pins":{"1":"CF1_OUT"}},"TP504":{"value":"IF1","lib":"Connector:TestPoint","desc":"Debug test point (bare pad): IF_C1","lcsc":"","mpn":"","sheet":"if","block":"tp","pins":{"1":"IF_C1"}},"TP505":{"value":"XO","lib":"Connector:TestPoint","desc":"Debug test point (bare pad): XO_E","lcsc":"","mpn":"","sheet":"if","block":"tp","pins":{"1":"XO_E"}},"TP506":{"value":"GND","lib":"Connector:TestPoint","desc":"Debug test point (bare pad): GND","lcsc":"","mpn":"","sheet":"if","block":"tp","pins":{"1":"GND"}},"R602":{"value":"22","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C23345","mpn":"","sheet":"amif","block":"amf","pins":{"1":"+5VA","2":"V_IF3"},"wiki":"https://wiki.adom.inc/adom/0603waf220jt5e"},"C603":{"value":"10u","lib":"Device:C","desc":"Capacitor","lcsc":"C15850","mpn":"","sheet":"amif","block":"amf","pins":{"1":"V_IF3","2":"GND"},"wiki":"https://wiki.adom.inc/adom/samsung-cl21a-x5r-0805"},"C604":{"value":"100n","lib":"Device:C","desc":"Capacitor","lcsc":"C14663","mpn":"","sheet":"amif","block":"amf","pins":{"1":"V_IF3","2":"GND"},"wiki":"https://wiki.adom.inc/adom/cc0603-100nf"},"C601":{"value":"10n","lib":"Device:C","desc":"Capacitor","lcsc":"C57112","mpn":"","sheet":"amif","block":"amf","pins":{"1":"IF2_OUT","2":"AMF_IN"},"wiki":"https://wiki.adom.inc/adom/fenghua-0603-mlcc"},"FL601":{"value":"HCCF2-455.000-LTWCGL","lib":"AMFM:CeramicFilter_4pin","desc":"455 kHz SMD ceramic filter, +/-4.5 kHz, 2 kohm","lcsc":"C19186014","mpn":"HCCF2-455.000-LTWCGL","sheet":"amif","block":"amf","pins":{"1":"AMF_IN","2":"AMF_OUT","3":"GND","4":"GND"},"wiki":"https://wiki.adom.inc/adom/hccf2-455-000-ltwcgl"},"R601":{"value":"2.7k","lib":"Device:R","desc":"Termination (with VGA input ~2 kohm total)","lcsc":"C13167","mpn":"","sheet":"amif","block":"amf","pins":{"1":"AMF_OUT","2":"GND"},"wiki":"https://wiki.adom.inc/adom/uniroyal-0603waf"},"C602":{"value":"10n","lib":"Device:C","desc":"Capacitor","lcsc":"C57112","mpn":"","sheet":"amif","block":"amf","pins":{"1":"AMF_OUT","2":"VGA1_IN"},"wiki":"https://wiki.adom.inc/adom/fenghua-0603-mlcc"},"R603":{"value":"6.8k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C23212","mpn":"","sheet":"amif","block":"amf","pins":{"1":"V_IF3","2":"VBIAS"},"wiki":"https://wiki.adom.inc/adom/0603waf6801t5e"},"R604":{"value":"10k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C25804","mpn":"","sheet":"amif","block":"amf","pins":{"1":"VBIAS","2":"GND"},"wiki":"https://wiki.adom.inc/adom/0603waf1002t5e"},"C605":{"value":"10u","lib":"Device:C","desc":"Capacitor","lcsc":"C15850","mpn":"","sheet":"amif","block":"amf","pins":{"1":"VBIAS","2":"GND"},"wiki":"https://wiki.adom.inc/adom/samsung-cl21a-x5r-0805"},"C606":{"value":"100n","lib":"Device:C","desc":"Capacitor","lcsc":"C14663","mpn":"","sheet":"amif","block":"amf","pins":{"1":"VBIAS","2":"GND"},"wiki":"https://wiki.adom.inc/adom/cc0603-100nf"},"R605":{"value":"10k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C25804","mpn":"","sheet":"amif","block":"vga","pins":{"1":"VBIAS","2":"VGA1_IN"},"wiki":"https://wiki.adom.inc/adom/0603waf1002t5e"},"Q601":{"value":"BC847BS","lib":"Transistor_BJT:BC847BS","desc":"VGA1 differential pair","lcsc":"C5380687","mpn":"BC847BS","sheet":"amif","block":"vga","pins":{"1":"VGA1_E","2":"VGA1_IN","6":"V_IF3","3":"VGA1_OUT","4":"VGA1_E","5":"VBIAS"},"wiki":"https://wiki.adom.inc/adom/bc847bs"},"Q602":{"value":"MMBT3904","lib":"Transistor_BJT:MMBT3904","desc":"VGA1 tail current source","lcsc":"C20526","mpn":"MMBT3904","sheet":"amif","block":"vga","pins":{"1":"AGC_B","2":"VGA1_T","3":"VGA1_E"},"wiki":"https://wiki.adom.inc/adom/mmbt3904"},"R606":{"value":"2.2k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C4190","mpn":"","sheet":"amif","block":"vga","pins":{"1":"V_IF3","2":"VGA1_OUT"},"wiki":"https://wiki.adom.inc/adom/uniroyal-0603waf"},"R607":{"value":"2k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C22975","mpn":"","sheet":"amif","block":"vga","pins":{"1":"VGA1_T","2":"GND"},"wiki":"https://wiki.adom.inc/adom/uniroyal-0603waf"},"C608":{"value":"10n","lib":"Device:C","desc":"Capacitor","lcsc":"C57112","mpn":"","sheet":"amif","block":"vga","pins":{"1":"VGA1_OUT","2":"VGA2_IN"},"wiki":"https://wiki.adom.inc/adom/fenghua-0603-mlcc"},"R610":{"value":"10k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C25804","mpn":"","sheet":"amif","block":"vga","pins":{"1":"VBIAS","2":"VGA2_IN"},"wiki":"https://wiki.adom.inc/adom/0603waf1002t5e"},"Q603":{"value":"BC847BS","lib":"Transistor_BJT:BC847BS","desc":"VGA2 differential pair","lcsc":"C5380687","mpn":"BC847BS","sheet":"amif","block":"vga","pins":{"1":"VGA2_E","2":"VGA2_IN","6":"V_IF3","3":"VGA2_OUT","4":"VGA2_E","5":"VBIAS"},"wiki":"https://wiki.adom.inc/adom/bc847bs"},"Q604":{"value":"MMBT3904","lib":"Transistor_BJT:MMBT3904","desc":"VGA2 tail current source","lcsc":"C20526","mpn":"MMBT3904","sheet":"amif","block":"vga","pins":{"1":"AGC_B","2":"VGA2_T","3":"VGA2_E"},"wiki":"https://wiki.adom.inc/adom/mmbt3904"},"R611":{"value":"2.2k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C4190","mpn":"","sheet":"amif","block":"vga","pins":{"1":"V_IF3","2":"VGA2_OUT"},"wiki":"https://wiki.adom.inc/adom/uniroyal-0603waf"},"R612":{"value":"2k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C22975","mpn":"","sheet":"amif","block":"vga","pins":{"1":"VGA2_T","2":"GND"},"wiki":"https://wiki.adom.inc/adom/uniroyal-0603waf"},"R608":{"value":"10k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C25804","mpn":"","sheet":"amif","block":"vga","pins":{"1":"V_AGC","2":"AGC_B"},"wiki":"https://wiki.adom.inc/adom/0603waf1002t5e"},"R609":{"value":"10k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C25804","mpn":"","sheet":"amif","block":"vga","pins":{"1":"AGC_B","2":"GND"},"wiki":"https://wiki.adom.inc/adom/0603waf1002t5e"},"C607":{"value":"100n","lib":"Device:C","desc":"Capacitor","lcsc":"C14663","mpn":"","sheet":"amif","block":"vga","pins":{"1":"AGC_B","2":"GND"},"wiki":"https://wiki.adom.inc/adom/cc0603-100nf"},"C609":{"value":"10n","lib":"Device:C","desc":"Capacitor","lcsc":"C57112","mpn":"","sheet":"amif","block":"det","pins":{"1":"VGA2_OUT","2":"AMP_B"},"wiki":"https://wiki.adom.inc/adom/fenghua-0603-mlcc"},"Q605":{"value":"MMBT3904","lib":"Transistor_BJT:MMBT3904","desc":"455 kHz post-amp","lcsc":"C20526","mpn":"MMBT3904","sheet":"amif","block":"det","pins":{"1":"AMP_B","2":"AMP_E","3":"AM_IFOUT"},"wiki":"https://wiki.adom.inc/adom/mmbt3904"},"R613":{"value":"33k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C4216","mpn":"","sheet":"amif","block":"det","pins":{"1":"V_IF3","2":"AMP_B"},"wiki":"https://wiki.adom.inc/adom/uniroyal-0603waf"},"R614":{"value":"10k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C25804","mpn":"","sheet":"amif","block":"det","pins":{"1":"AMP_B","2":"GND"},"wiki":"https://wiki.adom.inc/adom/0603waf1002t5e"},"R615":{"value":"47","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C23182","mpn":"","sheet":"amif","block":"det","pins":{"1":"AMP_E","2":"AMP_E2"},"wiki":"https://wiki.adom.inc/adom/0603waf470jt5e"},"R616":{"value":"330","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C23138","mpn":"","sheet":"amif","block":"det","pins":{"1":"AMP_E2","2":"GND"},"wiki":"https://wiki.adom.inc/adom/0603waf3300t5e"},"C610":{"value":"100n","lib":"Device:C","desc":"Capacitor","lcsc":"C14663","mpn":"","sheet":"amif","block":"det","pins":{"1":"AMP_E2","2":"GND"},"wiki":"https://wiki.adom.inc/adom/cc0603-100nf"},"R617":{"value":"2.2k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C4190","mpn":"","sheet":"amif","block":"det","pins":{"1":"V_IF3","2":"AM_IFOUT"},"wiki":"https://wiki.adom.inc/adom/uniroyal-0603waf"},"C611":{"value":"10n","lib":"Device:C","desc":"Capacitor","lcsc":"C57112","mpn":"","sheet":"amif","block":"det","pins":{"1":"AM_IFOUT","2":"DET_A"},"wiki":"https://wiki.adom.inc/adom/fenghua-0603-mlcc"},"R618":{"value":"47k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C25819","mpn":"","sheet":"amif","block":"det","pins":{"1":"DET_A","2":"GND"},"wiki":"https://wiki.adom.inc/adom/0603waf4702t5e"},"D601":{"value":"BAT54WS","lib":"Device:D_Schottky","desc":"Schottky diode 30 V 200 mA, SOD-323","lcsc":"C124205","mpn":"BAT54WS-7-F","sheet":"amif","block":"det","pins":{"1":"AM_DET","2":"DET_A"},"wiki":"https://wiki.adom.inc/adom/bat54ws-7-f"},"C612":{"value":"2.2n","lib":"Device:C","desc":"Capacitor","lcsc":"C296055","mpn":"","sheet":"amif","block":"det","pins":{"1":"AM_DET","2":"GND"},"wiki":"https://wiki.adom.inc/adom/0603n222j500ct"},"R619":{"value":"10k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C25804","mpn":"","sheet":"amif","block":"det","pins":{"1":"AM_DET","2":"GND"},"wiki":"https://wiki.adom.inc/adom/0603waf1002t5e"},"U601":{"value":"TLV9062IDR","lib":"Amplifier_Operational:TLV9062xD","desc":"Dual 10 MHz rail-to-rail I/O op-amp","lcsc":"C398355","mpn":"TLV9062IDR","sheet":"amif","block":"agc","pins":{"3":"AGC_REF","2":"AGC_N","1":"V_AGC","5":"AMA_P","6":"AMA_OUT","7":"AMA_OUT","8":"+5VA","4":"GND"},"wiki":"https://wiki.adom.inc/adom/tlv9062idr"},"R620":{"value":"100k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C25803","mpn":"","sheet":"amif","block":"agc","pins":{"1":"AM_DET","2":"AGC_N"},"wiki":"https://wiki.adom.inc/adom/uniroyal-0603waf"},"R623":{"value":"4.7k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C23162","mpn":"","sheet":"amif","block":"agc","pins":{"1":"V_AGC","2":"AGC_RC"},"wiki":"https://wiki.adom.inc/adom/0603waf4701t5e"},"C614":{"value":"1u","lib":"Device:C","desc":"Capacitor","lcsc":"C15849","mpn":"","sheet":"amif","block":"agc","pins":{"1":"AGC_RC","2":"AGC_N"},"wiki":"https://wiki.adom.inc/adom/cl10a105kb8nnnc"},"R621":{"value":"39k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C23153","mpn":"","sheet":"amif","block":"agc","pins":{"1":"V_IF3","2":"AGC_REF"},"wiki":"https://wiki.adom.inc/adom/uniroyal-0603waf"},"R622":{"value":"10k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C25804","mpn":"","sheet":"amif","block":"agc","pins":{"1":"AGC_REF","2":"GND"},"wiki":"https://wiki.adom.inc/adom/0603waf1002t5e"},"C613":{"value":"1u","lib":"Device:C","desc":"Capacitor","lcsc":"C15849","mpn":"","sheet":"amif","block":"agc","pins":{"1":"AGC_REF","2":"GND"},"wiki":"https://wiki.adom.inc/adom/cl10a105kb8nnnc"},"R624":{"value":"10k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C25804","mpn":"","sheet":"amif","block":"agc","pins":{"1":"V_AGC","2":"RSSI_AM"},"wiki":"https://wiki.adom.inc/adom/0603waf1002t5e"},"R625":{"value":"10k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C25804","mpn":"","sheet":"amif","block":"agc","pins":{"1":"RSSI_AM","2":"GND"},"wiki":"https://wiki.adom.inc/adom/0603waf1002t5e"},"C615":{"value":"100n","lib":"Device:C","desc":"Capacitor","lcsc":"C14663","mpn":"","sheet":"amif","block":"agc","pins":{"1":"RSSI_AM","2":"GND"},"wiki":"https://wiki.adom.inc/adom/cc0603-100nf"},"C616":{"value":"1u","lib":"Device:C","desc":"Capacitor","lcsc":"C15849","mpn":"","sheet":"amif","block":"agc","pins":{"1":"AM_DET","2":"AMA_IN"},"wiki":"https://wiki.adom.inc/adom/cl10a105kb8nnnc"},"R626":{"value":"100k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C25803","mpn":"","sheet":"amif","block":"agc","pins":{"1":"AMA_IN","2":"VREF_1V65"},"wiki":"https://wiki.adom.inc/adom/uniroyal-0603waf"},"R627":{"value":"10k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C25804","mpn":"","sheet":"amif","block":"agc","pins":{"1":"AMA_IN","2":"AMA_N1"},"wiki":"https://wiki.adom.inc/adom/0603waf1002t5e"},"R628":{"value":"10k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C25804","mpn":"","sheet":"amif","block":"agc","pins":{"1":"AMA_N1","2":"AMA_P"},"wiki":"https://wiki.adom.inc/adom/0603waf1002t5e"},"C617":{"value":"4.7n","lib":"Device:C","desc":"C0G","lcsc":"C576818","mpn":"","sheet":"amif","block":"agc","pins":{"1":"AMA_N1","2":"AMA_OUT"},"wiki":"https://wiki.adom.inc/adom/yageo-cc0603-npo"},"C618":{"value":"2.2n","lib":"Device:C","desc":"C0G","lcsc":"C296055","mpn":"","sheet":"amif","block":"agc","pins":{"1":"AMA_P","2":"GND"},"wiki":"https://wiki.adom.inc/adom/0603n222j500ct"},"R629":{"value":"1k","lib":"Device:R","desc":"Limits injection into the 3.3 V ADC pin if the 5 V op-amp swings high","lcsc":"C21190","mpn":"","sheet":"amif","block":"agc","pins":{"1":"AMA_OUT","2":"AM_AUDIO"},"wiki":"https://wiki.adom.inc/adom/0603waf1001t5e"},"C619":{"value":"1n","lib":"Device:C","desc":"ADC sampling reservoir","lcsc":"C1588","mpn":"","sheet":"amif","block":"agc","pins":{"1":"AM_AUDIO","2":"GND"},"wiki":"https://wiki.adom.inc/adom/cl10b102kb8nnnc"},"C620":{"value":"100n","lib":"Device:C","desc":"U601 decoupling","lcsc":"C14663","mpn":"","sheet":"amif","block":"agc","pins":{"1":"+5VA","2":"GND"},"wiki":"https://wiki.adom.inc/adom/cc0603-100nf"},"TP601":{"value":"VIF3","lib":"Connector:TestPoint","desc":"Debug test point (bare pad): V_IF3","lcsc":"","mpn":"","sheet":"amif","block":"tp","pins":{"1":"V_IF3"}},"TP602":{"value":"VB","lib":"Connector:TestPoint","desc":"Debug test point (bare pad): VBIAS","lcsc":"","mpn":"","sheet":"amif","block":"tp","pins":{"1":"VBIAS"}},"TP603":{"value":"AMF","lib":"Connector:TestPoint","desc":"Debug test point (bare pad): AMF_OUT","lcsc":"","mpn":"","sheet":"amif","block":"tp","pins":{"1":"AMF_OUT"}},"TP604":{"value":"VGA1","lib":"Connector:TestPoint","desc":"Debug test point (bare pad): VGA1_OUT","lcsc":"","mpn":"","sheet":"amif","block":"tp","pins":{"1":"VGA1_OUT"}},"TP605":{"value":"VGA2","lib":"Connector:TestPoint","desc":"Debug test point (bare pad): VGA2_OUT","lcsc":"","mpn":"","sheet":"amif","block":"tp","pins":{"1":"VGA2_OUT"}},"TP606":{"value":"AIF","lib":"Connector:TestPoint","desc":"Debug test point (bare pad): AM_IFOUT","lcsc":"","mpn":"","sheet":"amif","block":"tp","pins":{"1":"AM_IFOUT"}},"TP607":{"value":"AGC","lib":"Connector:TestPoint","desc":"Debug test point (bare pad): V_AGC","lcsc":"","mpn":"","sheet":"amif","block":"tp","pins":{"1":"V_AGC"}},"TP608":{"value":"RSA","lib":"Connector:TestPoint","desc":"Debug test point (bare pad): RSSI_AM","lcsc":"","mpn":"","sheet":"amif","block":"tp","pins":{"1":"RSSI_AM"}},"TP609":{"value":"AMA","lib":"Connector:TestPoint","desc":"Debug test point (bare pad): AMA_OUT","lcsc":"","mpn":"","sheet":"amif","block":"tp","pins":{"1":"AMA_OUT"}},"TP610":{"value":"GND","lib":"Connector:TestPoint","desc":"Debug test point (bare pad): GND","lcsc":"","mpn":"","sheet":"amif","block":"tp","pins":{"1":"GND"}},"TP611":{"value":"GND","lib":"Connector:TestPoint","desc":"Debug test point (bare pad): GND","lcsc":"","mpn":"","sheet":"amif","block":"tp","pins":{"1":"GND"}},"R701":{"value":"22","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C23345","mpn":"","sheet":"fmif","block":"lim","pins":{"1":"+5VA","2":"V_IF4"},"wiki":"https://wiki.adom.inc/adom/0603waf220jt5e"},"C701":{"value":"10u","lib":"Device:C","desc":"Capacitor","lcsc":"C15850","mpn":"","sheet":"fmif","block":"lim","pins":{"1":"V_IF4","2":"GND"},"wiki":"https://wiki.adom.inc/adom/samsung-cl21a-x5r-0805"},"C702":{"value":"100n","lib":"Device:C","desc":"Capacitor","lcsc":"C14663","mpn":"","sheet":"fmif","block":"lim","pins":{"1":"V_IF4","2":"GND"},"wiki":"https://wiki.adom.inc/adom/cc0603-100nf"},"C703":{"value":"1n","lib":"Device:C","desc":"Capacitor","lcsc":"C1588","mpn":"","sheet":"fmif","block":"lim","pins":{"1":"IF2_OUT","2":"FMF_1"},"wiki":"https://wiki.adom.inc/adom/cl10b102kb8nnnc"},"R702":{"value":"2.2k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C4190","mpn":"","sheet":"fmif","block":"lim","pins":{"1":"FMF_1","2":"FMF_2"},"wiki":"https://wiki.adom.inc/adom/uniroyal-0603waf"},"C704":{"value":"150p","lib":"Device:C","desc":"Capacitor","lcsc":"C107038","mpn":"","sheet":"fmif","block":"lim","pins":{"1":"FMF_2","2":"GND"},"wiki":"https://wiki.adom.inc/adom/yageo-cc0603-npo"},"C705":{"value":"10n","lib":"Device:C","desc":"Capacitor","lcsc":"C57112","mpn":"","sheet":"fmif","block":"lim","pins":{"1":"FMF_2","2":"LIM1_B"},"wiki":"https://wiki.adom.inc/adom/fenghua-0603-mlcc"},"Q701":{"value":"MMBT3904","lib":"Transistor_BJT:MMBT3904","desc":"Limiter stage 1","lcsc":"C20526","mpn":"MMBT3904","sheet":"fmif","block":"lim","pins":{"1":"LIM1_B","2":"LIM1_E","3":"LIM1_C"},"wiki":"https://wiki.adom.inc/adom/mmbt3904"},"R703":{"value":"33k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C4216","mpn":"","sheet":"fmif","block":"lim","pins":{"1":"V_IF4","2":"LIM1_B"},"wiki":"https://wiki.adom.inc/adom/uniroyal-0603waf"},"R704":{"value":"10k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C25804","mpn":"","sheet":"fmif","block":"lim","pins":{"1":"LIM1_B","2":"GND"},"wiki":"https://wiki.adom.inc/adom/0603waf1002t5e"},"R705":{"value":"470","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C23179","mpn":"","sheet":"fmif","block":"lim","pins":{"1":"LIM1_E","2":"GND"},"wiki":"https://wiki.adom.inc/adom/0603waf4700t5e"},"C706":{"value":"100n","lib":"Device:C","desc":"Capacitor","lcsc":"C14663","mpn":"","sheet":"fmif","block":"lim","pins":{"1":"LIM1_E","2":"GND"},"wiki":"https://wiki.adom.inc/adom/cc0603-100nf"},"R706":{"value":"2.2k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C4190","mpn":"","sheet":"fmif","block":"lim","pins":{"1":"V_IF4","2":"LIM1_C"},"wiki":"https://wiki.adom.inc/adom/uniroyal-0603waf"},"C707":{"value":"47p","lib":"Device:C","desc":"Capacitor","lcsc":"C1671","mpn":"","sheet":"fmif","block":"lim","pins":{"1":"LIM1_C","2":"GND"},"wiki":"https://wiki.adom.inc/adom/samsung-cl10c-c0g-0603"},"C708":{"value":"10n","lib":"Device:C","desc":"Capacitor","lcsc":"C57112","mpn":"","sheet":"fmif","block":"lim","pins":{"1":"LIM1_C","2":"LIM2_B"},"wiki":"https://wiki.adom.inc/adom/fenghua-0603-mlcc"},"Q702":{"value":"MMBT3904","lib":"Transistor_BJT:MMBT3904","desc":"Limiter stage 2","lcsc":"C20526","mpn":"MMBT3904","sheet":"fmif","block":"lim","pins":{"1":"LIM2_B","2":"LIM2_E","3":"LIM2_C"},"wiki":"https://wiki.adom.inc/adom/mmbt3904"},"R707":{"value":"33k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C4216","mpn":"","sheet":"fmif","block":"lim","pins":{"1":"V_IF4","2":"LIM2_B"},"wiki":"https://wiki.adom.inc/adom/uniroyal-0603waf"},"R708":{"value":"10k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C25804","mpn":"","sheet":"fmif","block":"lim","pins":{"1":"LIM2_B","2":"GND"},"wiki":"https://wiki.adom.inc/adom/0603waf1002t5e"},"R709":{"value":"470","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C23179","mpn":"","sheet":"fmif","block":"lim","pins":{"1":"LIM2_E","2":"GND"},"wiki":"https://wiki.adom.inc/adom/0603waf4700t5e"},"C709":{"value":"100n","lib":"Device:C","desc":"Capacitor","lcsc":"C14663","mpn":"","sheet":"fmif","block":"lim","pins":{"1":"LIM2_E","2":"GND"},"wiki":"https://wiki.adom.inc/adom/cc0603-100nf"},"R710":{"value":"2.2k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C4190","mpn":"","sheet":"fmif","block":"lim","pins":{"1":"V_IF4","2":"LIM2_C"},"wiki":"https://wiki.adom.inc/adom/uniroyal-0603waf"},"C710":{"value":"47p","lib":"Device:C","desc":"Capacitor","lcsc":"C1671","mpn":"","sheet":"fmif","block":"lim","pins":{"1":"LIM2_C","2":"GND"},"wiki":"https://wiki.adom.inc/adom/samsung-cl10c-c0g-0603"},"C711":{"value":"10n","lib":"Device:C","desc":"Capacitor","lcsc":"C57112","mpn":"","sheet":"fmif","block":"rssi","pins":{"1":"LIM1_C","2":"RS_A"},"wiki":"https://wiki.adom.inc/adom/fenghua-0603-mlcc"},"R711":{"value":"47k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C25819","mpn":"","sheet":"fmif","block":"rssi","pins":{"1":"RS_A","2":"GND"},"wiki":"https://wiki.adom.inc/adom/0603waf4702t5e"},"D701":{"value":"BAT54WS","lib":"Device:D_Schottky","desc":"Schottky diode 30 V 200 mA, SOD-323","lcsc":"C124205","mpn":"BAT54WS-7-F","sheet":"fmif","block":"rssi","pins":{"1":"RSSI_FM","2":"RS_A"},"wiki":"https://wiki.adom.inc/adom/bat54ws-7-f"},"C712":{"value":"100n","lib":"Device:C","desc":"Capacitor","lcsc":"C14663","mpn":"","sheet":"fmif","block":"rssi","pins":{"1":"RSSI_FM","2":"GND"},"wiki":"https://wiki.adom.inc/adom/cc0603-100nf"},"R712":{"value":"100k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C25803","mpn":"","sheet":"fmif","block":"rssi","pins":{"1":"RSSI_FM","2":"GND"},"wiki":"https://wiki.adom.inc/adom/uniroyal-0603waf"},"R713":{"value":"10k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C25804","mpn":"","sheet":"fmif","block":"sq","pins":{"1":"LIM2_C","2":"SQ_B"},"wiki":"https://wiki.adom.inc/adom/0603waf1002t5e"},"C713":{"value":"100p","lib":"Device:C","desc":"Speed-up capacitor","lcsc":"C14858","mpn":"","sheet":"fmif","block":"sq","pins":{"1":"LIM2_C","2":"SQ_B"},"wiki":"https://wiki.adom.inc/adom/samsung-cl10c-c0g-0603"},"R714":{"value":"4.7k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C23162","mpn":"","sheet":"fmif","block":"sq","pins":{"1":"SQ_B","2":"GND"},"wiki":"https://wiki.adom.inc/adom/0603waf4701t5e"},"Q703":{"value":"MMBT3904","lib":"Transistor_BJT:MMBT3904","desc":"Squarer","lcsc":"C20526","mpn":"MMBT3904","sheet":"fmif","block":"sq","pins":{"1":"SQ_B","2":"GND","3":"LIM_SQ"},"wiki":"https://wiki.adom.inc/adom/mmbt3904"},"R715":{"value":"1k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C21190","mpn":"","sheet":"fmif","block":"sq","pins":{"1":"V_IF4","2":"LIM_SQ"},"wiki":"https://wiki.adom.inc/adom/0603waf1001t5e"},"R716":{"value":"4.7k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C23162","mpn":"","sheet":"fmif","block":"sq","pins":{"1":"LIM_SQ","2":"IF_CNT"},"wiki":"https://wiki.adom.inc/adom/0603waf4701t5e"},"R717":{"value":"10k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C25804","mpn":"","sheet":"fmif","block":"sq","pins":{"1":"IF_CNT","2":"GND"},"wiki":"https://wiki.adom.inc/adom/0603waf1002t5e"},"C714":{"value":"22p","lib":"Device:C","desc":"C0G, pump capacitor (sets detector gain)","lcsc":"C1653","mpn":"","sheet":"fmif","block":"pump","pins":{"1":"LIM_SQ","2":"PUMP"},"wiki":"https://wiki.adom.inc/adom/samsung-cl10c-c0g-0603"},"D702":{"value":"BAT54S","lib":"Diode:BAT54S","desc":"Dual series Schottky (diode pump)","lcsc":"C408389","mpn":"","sheet":"fmif","block":"pump","pins":{"1":"VREF_FM","2":"SUMJ","3":"PUMP"},"wiki":"https://wiki.adom.inc/adom/bat54s"},"U701":{"value":"TLV9062IDR","lib":"Amplifier_Operational:TLV9062xD","desc":"Dual 10 MHz rail-to-rail I/O op-amp","lcsc":"C398355","mpn":"TLV9062IDR","sheet":"fmif","block":"pump","pins":{"3":"VREF_FM","2":"SUMJ","1":"FM_DEMOD","5":"FMA_P","6":"FMA_OUT","7":"FMA_OUT","8":"+5VA","4":"GND"},"wiki":"https://wiki.adom.inc/adom/tlv9062idr"},"R718":{"value":"51k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C23196","mpn":"","sheet":"fmif","block":"pump","pins":{"1":"FM_DEMOD","2":"SUMJ"},"wiki":"https://wiki.adom.inc/adom/0603waf5102t5e"},"C715":{"value":"1.5n","lib":"Device:C","desc":"C0G, de-emphasis 75 us","lcsc":"C107039","mpn":"","sheet":"fmif","block":"pump","pins":{"1":"FM_DEMOD","2":"SUMJ"},"wiki":"https://wiki.adom.inc/adom/yageo-cc0603-npo"},"R725":{"value":"1.2k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C22765","mpn":"","sheet":"fmif","block":"pump","pins":{"1":"V_IF4","2":"VREF_FM"},"wiki":"https://wiki.adom.inc/adom/uniroyal-0603waf"},"R726":{"value":"4.3k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C23159","mpn":"","sheet":"fmif","block":"pump","pins":{"1":"VREF_FM","2":"GND"},"wiki":"https://wiki.adom.inc/adom/uniroyal-0603waf"},"C722":{"value":"10u","lib":"Device:C","desc":"Capacitor","lcsc":"C15850","mpn":"","sheet":"fmif","block":"pump","pins":{"1":"VREF_FM","2":"GND"},"wiki":"https://wiki.adom.inc/adom/samsung-cl21a-x5r-0805"},"C723":{"value":"100n","lib":"Device:C","desc":"Capacitor","lcsc":"C14663","mpn":"","sheet":"fmif","block":"pump","pins":{"1":"VREF_FM","2":"GND"},"wiki":"https://wiki.adom.inc/adom/cc0603-100nf"},"C721":{"value":"100n","lib":"Device:C","desc":"U701 decoupling","lcsc":"C14663","mpn":"","sheet":"fmif","block":"pump","pins":{"1":"+5VA","2":"GND"},"wiki":"https://wiki.adom.inc/adom/cc0603-100nf"},"R719":{"value":"100k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C25803","mpn":"","sheet":"fmif","block":"fmaud","pins":{"1":"FM_DEMOD","2":"FM_DC"},"wiki":"https://wiki.adom.inc/adom/uniroyal-0603waf"},"R720":{"value":"200k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C25811","mpn":"","sheet":"fmif","block":"fmaud","pins":{"1":"FM_DC","2":"GND"},"wiki":"https://wiki.adom.inc/adom/uniroyal-0603waf"},"C716":{"value":"1u","lib":"Device:C","desc":"Capacitor","lcsc":"C15849","mpn":"","sheet":"fmif","block":"fmaud","pins":{"1":"FM_DC","2":"GND"},"wiki":"https://wiki.adom.inc/adom/cl10a105kb8nnnc"},"C717":{"value":"1u","lib":"Device:C","desc":"Capacitor","lcsc":"C15849","mpn":"","sheet":"fmif","block":"fmaud","pins":{"1":"FM_DEMOD","2":"FMA_IN"},"wiki":"https://wiki.adom.inc/adom/cl10a105kb8nnnc"},"R721":{"value":"100k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C25803","mpn":"","sheet":"fmif","block":"fmaud","pins":{"1":"FMA_IN","2":"VREF_1V65"},"wiki":"https://wiki.adom.inc/adom/uniroyal-0603waf"},"R722":{"value":"10k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C25804","mpn":"","sheet":"fmif","block":"fmaud","pins":{"1":"FMA_IN","2":"FMA_N1"},"wiki":"https://wiki.adom.inc/adom/0603waf1002t5e"},"R723":{"value":"10k","lib":"Device:R","desc":"Resistor, 1 %, 0603","lcsc":"C25804","mpn":"","sheet":"fmif","block":"fmaud","pins":{"1":"FMA_N1","2":"FMA_P"},"wiki":"https://wiki.adom.inc/adom/0603waf1002t5e"},"C718":{"value":"1.5n","lib":"Device:C","desc":"C0G","lcsc":"C107039","mpn":"","sheet":"fmif","block":"fmaud","pins":{"1":"FMA_N1","2":"FMA_OUT"},"wiki":"https://wiki.adom.inc/adom/yageo-cc0603-npo"},"C719":{"value":"680p","lib":"Device:C","desc":"C0G","lcsc":"C107055","mpn":"","sheet":"fmif","block":"fmaud","pins":{"1":"FMA_P","2":"GND"},"wiki":"https://wiki.adom.inc/adom/yageo-cc0603-npo"},"R724":{"value":"1k","lib":"Device:R","desc":"Limits injection into the 3.3 V ADC pin if the 5 V op-amp swings high","lcsc":"C21190","mpn":"","sheet":"fmif","block":"fmaud","pins":{"1":"FMA_OUT","2":"FM_AUDIO"},"wiki":"https://wiki.adom.inc/adom/0603waf1001t5e"},"C720":{"value":"1n","lib":"Device:C","desc":"ADC sampling reservoir","lcsc":"C1588","mpn":"","sheet":"fmif","block":"fmaud","pins":{"1":"FM_AUDIO","2":"GND"},"wiki":"https://wiki.adom.inc/adom/cl10b102kb8nnnc"},"TP701":{"value":"VIF4","lib":"Connector:TestPoint","desc":"Debug test point (bare pad): V_IF4","lcsc":"","mpn":"","sheet":"fmif","block":"tp","pins":{"1":"V_IF4"}},"TP702":{"value":"LIM1","lib":"Connector:TestPoint","desc":"Debug test point (bare pad): LIM1_C","lcsc":"","mpn":"","sheet":"fmif","block":"tp","pins":{"1":"LIM1_C"}},"TP703":{"value":"LIM2","lib":"Connector:TestPoint","desc":"Debug test point (bare pad): LIM2_C","lcsc":"","mpn":"","sheet":"fmif","block":"tp","pins":{"1":"LIM2_C"}},"TP704":{"value":"RSF","lib":"Connector:TestPoint","desc":"Debug test point (bare pad): RSSI_FM","lcsc":"","mpn":"","sheet":"fmif","block":"tp","pins":{"1":"RSSI_FM"}},"TP705":{"value":"CNT","lib":"Connector:TestPoint","desc":"Debug test point (bare pad): IF_CNT","lcsc":"","mpn":"","sheet":"fmif","block":"tp","pins":{"1":"IF_CNT"}},"TP706":{"value":"VRFM","lib":"Connector:TestPoint","desc":"Debug test point (bare pad): VREF_FM","lcsc":"","mpn":"","sheet":"fmif","block":"tp","pins":{"1":"VREF_FM"}},"TP707":{"value":"FMDC","lib":"Connector:TestPoint","desc":"Debug test point (bare pad): FM_DC","lcsc":"","mpn":"","sheet":"fmif","block":"tp","pins":{"1":"FM_DC"}},"TP708":{"value":"FMA","lib":"Connector:TestPoint","desc":"Debug test point (bare pad): FMA_OUT","lcsc":"","mpn":"","sheet":"fmif","block":"tp","pins":{"1":"FMA_OUT"}},"TP709":{"value":"GND","lib":"Connector:TestPoint","desc":"Debug test point (bare pad): GND","lcsc":"","mpn":"","sheet":"fmif","block":"tp","pins":{"1":"GND"}},"TP710":{"value":"GND","lib":"Connector:TestPoint","desc":"Debug test point (bare pad): GND","lcsc":"","mpn":"","sheet":"fmif","block":"tp","pins":{"1":"GND"}},"MP1":{"value":"MachinePinLargeStandard","lib":"AdomMachine:MachinePinLargeStandard","desc":"Adom machine pin, large / standard (corner: pincer grip + GND)","lcsc":"","mpn":"MachinePinLargeStandard","sheet":"mol","block":"pins","pins":{"1":"GND"},"wiki":"https://wiki.adom.inc/adom/machinepinlargestandard"},"MP2":{"value":"MachinePinLargeStandard","lib":"AdomMachine:MachinePinLargeStandard","desc":"Adom machine pin, large / standard (corner: pincer grip + GND)","lcsc":"","mpn":"MachinePinLargeStandard","sheet":"mol","block":"pins","pins":{"1":"GND"},"wiki":"https://wiki.adom.inc/adom/machinepinlargestandard"},"MP3":{"value":"MachinePinLargeStandard","lib":"AdomMachine:MachinePinLargeStandard","desc":"Adom machine pin, large / standard (corner: pincer grip + GND)","lcsc":"","mpn":"MachinePinLargeStandard","sheet":"mol","block":"pins","pins":{"1":"GND"},"wiki":"https://wiki.adom.inc/adom/machinepinlargestandard"},"MP4":{"value":"MachinePinLargeStandard","lib":"AdomMachine:MachinePinLargeStandard","desc":"Adom machine pin, large / standard (corner: pincer grip + GND)","lcsc":"","mpn":"MachinePinLargeStandard","sheet":"mol","block":"pins","pins":{"1":"GND"},"wiki":"https://wiki.adom.inc/adom/machinepinlargestandard"},"MC1":{"value":"5V","lib":"AdomMachine:MachineContactMedium","desc":"Adom machine contact, medium: VIN","lcsc":"","mpn":"MachineContactMedium","sheet":"mol","block":"edge","pins":{"1":"VIN"},"wiki":"https://wiki.adom.inc/adom/machinecontactmedium"},"MC2":{"value":"GND","lib":"AdomMachine:MachineContactMedium","desc":"Adom machine contact, medium: GND","lcsc":"","mpn":"MachineContactMedium","sheet":"mol","block":"edge","pins":{"1":"GND"},"wiki":"https://wiki.adom.inc/adom/machinecontactmedium"},"MC3":{"value":"D+","lib":"AdomMachine:MachineContactMedium","desc":"Adom machine contact, medium: USB_DP","lcsc":"","mpn":"MachineContactMedium","sheet":"mol","block":"edge","pins":{"1":"USB_DP"},"wiki":"https://wiki.adom.inc/adom/machinecontactmedium"},"MC4":{"value":"D-","lib":"AdomMachine:MachineContactMedium","desc":"Adom machine contact, medium: USB_DM","lcsc":"","mpn":"MachineContactMedium","sheet":"mol","block":"edge","pins":{"1":"USB_DM"},"wiki":"https://wiki.adom.inc/adom/machinecontactmedium"},"MC5":{"value":"GND","lib":"AdomMachine:MachineContactMedium","desc":"Adom machine contact, medium: GND","lcsc":"","mpn":"MachineContactMedium","sheet":"mol","block":"edge","pins":{"1":"GND"},"wiki":"https://wiki.adom.inc/adom/machinecontactmedium"},"MC6":{"value":"3V3","lib":"AdomMachine:MachineContactMedium","desc":"Adom machine contact, medium: +3V3","lcsc":"","mpn":"MachineContactMedium","sheet":"mol","block":"edge","pins":{"1":"+3V3"},"wiki":"https://wiki.adom.inc/adom/machinecontactmedium"},"MC7":{"value":"CLK","lib":"AdomMachine:MachineContactMedium","desc":"Adom machine contact, medium: SWCLK","lcsc":"","mpn":"MachineContactMedium","sheet":"mol","block":"edge","pins":{"1":"SWCLK"},"wiki":"https://wiki.adom.inc/adom/machinecontactmedium"},"MC8":{"value":"RST","lib":"AdomMachine:MachineContactMedium","desc":"Adom machine contact, medium: NRST","lcsc":"","mpn":"MachineContactMedium","sheet":"mol","block":"edge","pins":{"1":"NRST"},"wiki":"https://wiki.adom.inc/adom/machinecontactmedium"},"MC9":{"value":"GND","lib":"AdomMachine:MachineContactMedium","desc":"Adom machine contact, medium: GND","lcsc":"","mpn":"MachineContactMedium","sheet":"mol","block":"edge","pins":{"1":"GND"},"wiki":"https://wiki.adom.inc/adom/machinecontactmedium"},"MC10":{"value":"DIO","lib":"AdomMachine:MachineContactMedium","desc":"Adom machine contact, medium: SWDIO","lcsc":"","mpn":"MachineContactMedium","sheet":"mol","block":"edge","pins":{"1":"SWDIO"},"wiki":"https://wiki.adom.inc/adom/machinecontactmedium"},"MC11":{"value":"GND","lib":"AdomMachine:MachineContactMedium","desc":"Adom machine contact, medium: GND","lcsc":"","mpn":"MachineContactMedium","sheet":"mol","block":"edge","pins":{"1":"GND"},"wiki":"https://wiki.adom.inc/adom/machinecontactmedium"},"MC12":{"value":"TX","lib":"AdomMachine:MachineContactMedium","desc":"Adom machine contact, medium: UART_TX","lcsc":"","mpn":"MachineContactMedium","sheet":"mol","block":"edge","pins":{"1":"UART_TX"},"wiki":"https://wiki.adom.inc/adom/machinecontactmedium"},"MC13":{"value":"RX","lib":"AdomMachine:MachineContactMedium","desc":"Adom machine contact, medium: UART_RX","lcsc":"","mpn":"MachineContactMedium","sheet":"mol","block":"edge","pins":{"1":"UART_RX"},"wiki":"https://wiki.adom.inc/adom/machinecontactmedium"},"MC14":{"value":"GND","lib":"AdomMachine:MachineContactMedium","desc":"Adom machine contact, medium: GND","lcsc":"","mpn":"MachineContactMedium","sheet":"mol","block":"edge","pins":{"1":"GND"},"wiki":"https://wiki.adom.inc/adom/machinecontactmedium"},"MC15":{"value":"AM","lib":"AdomMachine:MachineContactMedium","desc":"Adom machine contact, medium: AM_AUDIO","lcsc":"","mpn":"MachineContactMedium","sheet":"mol","block":"edge","pins":{"1":"AM_AUDIO"},"wiki":"https://wiki.adom.inc/adom/machinecontactmedium"},"MC16":{"value":"FM","lib":"AdomMachine:MachineContactMedium","desc":"Adom machine contact, medium: FM_AUDIO","lcsc":"","mpn":"MachineContactMedium","sheet":"mol","block":"edge","pins":{"1":"FM_AUDIO"},"wiki":"https://wiki.adom.inc/adom/machinecontactmedium"},"MC17":{"value":"GND","lib":"AdomMachine:MachineContactMedium","desc":"Adom machine contact, medium: GND","lcsc":"","mpn":"MachineContactMedium","sheet":"mol","block":"edge","pins":{"1":"GND"},"wiki":"https://wiki.adom.inc/adom/machinecontactmedium"},"MC18":{"value":"ANT","lib":"AdomMachine:MachineContactMedium","desc":"Adom machine contact, medium: ANT","lcsc":"","mpn":"MachineContactMedium","sheet":"mol","block":"edge","pins":{"1":"ANT"},"wiki":"https://wiki.adom.inc/adom/machinecontactmedium"},"MC19":{"value":"GND","lib":"AdomMachine:MachineContactMedium","desc":"Adom machine contact, medium: GND","lcsc":"","mpn":"MachineContactMedium","sheet":"mol","block":"edge","pins":{"1":"GND"},"wiki":"https://wiki.adom.inc/adom/machinecontactmedium"},"MC20":{"value":"10M7","lib":"AdomMachine:MachineContactMedium","desc":"Adom machine contact, medium: CF2_OUT","lcsc":"","mpn":"MachineContactMedium","sheet":"mol","block":"probe","pins":{"1":"CF2_OUT"},"wiki":"https://wiki.adom.inc/adom/machinecontactmedium"},"MC21":{"value":"455K","lib":"AdomMachine:MachineContactMedium","desc":"Adom machine contact, medium: IF2_OUT","lcsc":"","mpn":"MachineContactMedium","sheet":"mol","block":"probe","pins":{"1":"IF2_OUT"},"wiki":"https://wiki.adom.inc/adom/machinecontactmedium"},"MC22":{"value":"DET","lib":"AdomMachine:MachineContactMedium","desc":"Adom machine contact, medium: AM_DET","lcsc":"","mpn":"MachineContactMedium","sheet":"mol","block":"probe","pins":{"1":"AM_DET"},"wiki":"https://wiki.adom.inc/adom/machinecontactmedium"},"MC23":{"value":"DEM","lib":"AdomMachine:MachineContactMedium","desc":"Adom machine contact, medium: FM_DEMOD","lcsc":"","mpn":"MachineContactMedium","sheet":"mol","block":"probe","pins":{"1":"FM_DEMOD"},"wiki":"https://wiki.adom.inc/adom/machinecontactmedium"},"MC24":{"value":"SQ","lib":"AdomMachine:MachineContactMedium","desc":"Adom machine contact, medium: LIM_SQ","lcsc":"","mpn":"MachineContactMedium","sheet":"mol","block":"probe","pins":{"1":"LIM_SQ"},"wiki":"https://wiki.adom.inc/adom/machinecontactmedium"},"MC25":{"value":"VTF","lib":"AdomMachine:MachineContactMedium","desc":"Adom machine contact, medium: VT_FM","lcsc":"","mpn":"MachineContactMedium","sheet":"mol","block":"probe","pins":{"1":"VT_FM"},"wiki":"https://wiki.adom.inc/adom/machinecontactmedium"},"MC26":{"value":"VTA","lib":"AdomMachine:MachineContactMedium","desc":"Adom machine contact, medium: VT_AM","lcsc":"","mpn":"MachineContactMedium","sheet":"mol","block":"probe","pins":{"1":"VT_AM"},"wiki":"https://wiki.adom.inc/adom/machinecontactmedium"},"MC27":{"value":"VTR","lib":"AdomMachine:MachineContactMedium","desc":"Adom machine contact, medium: VT_RF","lcsc":"","mpn":"MachineContactMedium","sheet":"mol","block":"probe","pins":{"1":"VT_RF"},"wiki":"https://wiki.adom.inc/adom/machinecontactmedium"},"MC28":{"value":"5VA","lib":"AdomMachine:MachineContactMedium","desc":"Adom machine contact, medium: +5VA","lcsc":"","mpn":"MachineContactMedium","sheet":"mol","block":"probe","pins":{"1":"+5VA"},"wiki":"https://wiki.adom.inc/adom/machinecontactmedium"}}};
var BLOCK_SRC = {"usb": [301, 326], "reg": [328, 341], "mcu": [343, 370], "vt": [378, 393], "pwm": [395, 411], "band": [413, 424], "ui": [426, 437], "ant": [446, 465], "fmrf": [467, 485], "fmlo": [487, 504], "fmmix": [506, 512], "amrf": [521, 535], "amlo": [537, 553], "ammix": [555, 561], "cf1": [570, 581], "ifamp": [583, 596], "mix2": [598, 608], "xo": [610, 622], "amf": [631, 645], "vga": [647, 662], "det": [664, 677], "agc": [679, 700], "lim": [709, 731], "rssi": [733, 738], "sq": [740, 748], "pump": [750, 762], "fmaud": [764, 776], "pins": [811, 813], "edge": [814, 818], "probe": [819, 822]};
// sch.js registers SCH on `self`: give it a local one, not the wiki page's window
var self = {};
/* sch.js: a small schematic renderer and netlist checker for the AM/FM circuit explorer.
*
* One file shared by the page (window.SCH) and by check.js (node). A block drawing is plain data:
*
* {
* id: 'fmrf', sheet: 'fmfe', w: 520, h: 360, // id = the design.py block key; w/h in px
* parts: [['Q301', 160, 200], ['R303', 130, 150, 'r90'], ['U201A', 200, 100, 'my lt'], ...],
* wires: [['C307.2', 'Q301.b'], ['Q301.c', [170, 150], 'vh', 'L306.1'], ...],
* gnd: ['R304.2', ['C308.2', 'down']],
* rails: [['R308.1', '+5V_FM', 'right']], // supply symbol with the net name
* flags: [['C313.2', 'FM_MIX_B', 'right']], // off-block net label (click = go to the other block)
* notes: [[300, 290, 'LC tank, tuned by VT_RF']], // [x, y, text, anchor?]
* boxes: [[100, 35, 230, 100, 'AM: 2 MHz low-pass']],
* }
*
* Part options (string tokens): r90 r180 r270 (clockwise), mx / my (mirror before rotating),
* lt lb ll lr (label top / bottom / left / right), ln (no label). An optional object after the
* string may carry {label: [dx, dy, anchor], text: 'inner text', box: BOXSPEC}.
* Pin references are 'PART.pin'. Pin names: R C L FB F crystal: 1 2; diodes: k a; BJT: b c e;
* op-amp unit (U201A / U201B): + - o; ceramic filter: in out g (4-pin: g1 g2); BAT54S: a k m;
* coax: sig sh; test point / machine contact: p; boxes: the names in their spec.
* Wire items are pin references or [x, y] points; 'hv' (default) or 'vh' between two points sets
* which way the corner goes.
*/
(function (root, factory) {
if (typeof module === 'object' && module.exports) module.exports = factory();
else root.SCH = factory();
})(typeof self !== 'undefined' ? self : this, function () {
'use strict';
// ------------------------------------------------------------------ symbols (local coords, rot 0)
const TWO = { '1': [-20, 0], '2': [20, 0] };
const DIO = { k: [-20, 0], a: [20, 0] };
const TRI_L = 'M6,-6L6,6L-6,0Z'; // diode body, pointing at the cathode (left)
const SYM = {
R: { pins: TWO, d: 'M-20,0H-12l2,-5l4,10l4,-10l4,10l4,-10l4,10l2,-5H20', bb: [-13, -6, 13, 6] },
C: { pins: TWO, d: 'M-20,0H-3M-3,-8V8M3,-8V8M3,0H20', bb: [-4, -9, 4, 9] },
L: { pins: TWO, d: 'M-20,0H-14a3.5,3.5 0 0 1 7,0a3.5,3.5 0 0 1 7,0a3.5,3.5 0 0 1 7,0a3.5,3.5 0 0 1 7,0H20', bb: [-14, -5, 14, 2] },
FB: { pins: TWO, d: 'M-20,0H-10M10,0H20', f: 'M-10,-4.5h20v9h-20z', bb: [-10, -5, 10, 5] },
F: { pins: TWO, d: 'M-20,0H20M-10,-4.5h20v9h-20zM-14,8H-8L8,-8', bb: [-14, -9, 10, 9] },
D: { pins: DIO, d: 'M-20,0H-6M6,0H20M-6,-6V6', f: TRI_L, bb: [-7, -7, 7, 7] },
DS: { pins: DIO, d: 'M-20,0H-6M6,0H20M-3,-4V-6H-6V6H-9V4', f: TRI_L, bb: [-9, -7, 7, 7] },
DV: { pins: DIO, d: 'M-20,0H-10M6,0H20M-6,-6V6M-10,-6V6', f: TRI_L, bb: [-11, -7, 7, 7] },
LED: { pins: DIO, d: 'M-20,0H-6M6,0H20M-6,-6V6M-1,-8L3,-13M4,-8L8,-13', f: TRI_L + 'M4.5,-15l-0.5,4l-2.6,-2zM9.5,-15l-0.5,4l-2.6,-2z', bb: [-7, -15, 10, 7] },
XTAL: { pins: TWO, d: 'M-20,0H-8M-8,-7V7M8,-7V7M8,0H20M-4,-9h8v18h-8z', bb: [-9, -10, 9, 10] },
NPN: { pins: { b: [-20, 0], c: [10, -20], e: [10, 20] }, d: 'M-20,0H-6M-6,-10V10M-6,-4L10,-14V-20M-6,4L10,14V20',
f: 'M7.6,12.5L2,12L4.7,7.7Z', circle: [2, 0, 15], bb: [-13, -15, 17, 15] },
PNP: { pins: { b: [-20, 0], c: [10, -20], e: [10, 20] }, d: 'M-20,0H-6M-6,-10V10M-6,-4L10,-14V-20M-6,4L10,14V20',
f: 'M-1.2,7L4.3,7.3L1.7,11.6Z', circle: [2, 0, 15], bb: [-13, -15, 17, 15] },
OPAMP: { pins: { '-': [-30, -10], '+': [-30, 10], o: [30, 0] },
d: 'M-20,-22L-20,22L22,0ZM-30,-10H-20M-30,10H-20M22,0H30M-17,-10H-11M-17,10H-11M-14,7V13', bb: [-20, -22, 22, 22] },
CF3: { pins: { in: [-30, 0], out: [30, 0], g: [0, 20] }, d: 'M-30,0H-16M16,0H30M0,9V20M-16,-9h32v18h-32z', bb: [-16, -9, 16, 9] },
CF4: { pins: { in: [-30, 0], out: [30, 0], g1: [-8, 20], g2: [8, 20] }, d: 'M-30,0H-16M16,0H30M-8,9V20M8,9V20M-16,-9h32v18h-32z', bb: [-16, -9, 16, 9] },
BAT54S: { pins: { a: [-40, 0], k: [40, 0], m: [0, -20] }, d: 'M-40,0H-26M-14,0H14M26,0H40M-14,-6V6M26,-6V6M0,0V-20',
f: 'M-26,-6L-26,6L-14,0ZM14,-6L14,6L26,0Z', dots: [[0, 0]], bb: [-27, -7, 27, 7] },
COAX: { pins: { sig: [20, 0], sh: [0, 20] }, d: 'M2.5,0H20M0,9V20', circle: [0, 0, 9], f: 'M-2.5,0a2.5,2.5 0 1 0 5,0a2.5,2.5 0 1 0 -5,0z', bb: [-10, -10, 10, 10] },
TP: { pins: { p: [0, 0] }, d: 'M0,0V-6', circle: [0, -10, 4], bb: [-5, -15, 5, 0], tp: true },
MC: { pins: { p: [0, 0] }, d: 'M0,0V-6', f: 'M-4,-14h8v8h-8z', bb: [-5, -15, 5, 0], tp: true, mc: true },
};
// design.py lib id -> [symbol, {symbol pin: [part pin numbers]} | {units}, hidden pins allowed]
const P2 = { '1': ['1'], '2': ['2'] };
const PD = { k: ['1'], a: ['2'] };
const PBJT = { b: ['1'], e: ['2'], c: ['3'] };
const LIB = {
'Device:R': ['R', P2], 'Device:C': ['C', P2], 'Device:L': ['L', P2],
'Device:FerriteBead': ['FB', P2], 'Device:Polyfuse': ['F', P2],
'Device:D_Schottky': ['DS', PD], 'Device:D_Capacitance': ['DV', PD], 'Device:LED': ['LED', PD],
'Device:Crystal_GND24': ['XTAL', { '1': ['1'], '2': ['3'] }, ['2', '4']],
'Transistor_BJT:MMBT3904': ['NPN', PBJT], 'Transistor_BJT:MMBT3906': ['PNP', PBJT],
'Transistor_BJT:BC847BS': ['NPN', { A: { b: ['2'], c: ['6'], e: ['1'] }, B: { b: ['5'], c: ['3'], e: ['4'] } }],
'Amplifier_Operational:TLV9062xD': ['OPAMP', { A: { '+': ['3'], '-': ['2'], o: ['1'] }, B: { '+': ['5'], '-': ['6'], o: ['7'] } }, ['8', '4']],
'AMFM:CeramicFilter_3pin': ['CF3', { in: ['1'], g: ['2'], out: ['3'] }],
'AMFM:CeramicFilter_4pin': ['CF4', { in: ['1'], out: ['2'], g1: ['3'], g2: ['4'] }],
'Diode:BAT54S': ['BAT54S', { a: ['1'], k: ['2'], m: ['3'] }],
'Connector:Conn_Coaxial': ['COAX', { sig: ['1'], sh: ['2'] }],
'Connector:TestPoint': ['TP', { p: ['1'] }],
'AdomMachine:MachineContactMedium': ['MC', { p: ['1'] }],
'AdomMachine:MachinePinLargeStandard': ['MC', { p: ['1'] }],
};
const TWO_TERM = new Set(['R', 'C', 'L', 'FB', 'F', 'D', 'DS', 'DV', 'LED', 'XTAL']);
// ------------------------------------------------------------------ geometry helpers
function xf(pt, P) {
let x = pt[0], y = pt[1];
if (P.mx) x = -x;
if (P.my) y = -y;
if (P.rot === 90) { const t = x; x = -y; y = t; }
else if (P.rot === 180) { x = -x; y = -y; }
else if (P.rot === 270) { const t = x; x = y; y = -t; }
return [P.x + x, P.y + y];
}
function bbox(bb, P) {
const a = xf([bb[0], bb[1]], P), b = xf([bb[2], bb[3]], P);
return [Math.min(a[0], b[0]), Math.min(a[1], b[1]), Math.max(a[0], b[0]), Math.max(a[1], b[1])];
}
const K = (p) => Math.round(p[0] * 10) / 10 + ',' + Math.round(p[1] * 10) / 10;
const esc = (s) => String(s).replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"');
const CW = 5.6; // mono glyph width at the label size, for flag widths
function parseOpts(s, o) {
if (typeof o === 'string') { s = (s || '') + ' ' + o; o = null; }
const P = { rot: 0, mx: false, my: false, lab: null, text: null, box: null, labxy: null };
for (const t of String(s || '').split(/\s+/).filter(Boolean)) {
if (/^r(90|180|270|0)$/.test(t)) P.rot = +t.slice(1);
else if (t === 'mx') P.mx = true;
else if (t === 'my') P.my = true;
else if (/^l[tblrn]$/.test(t)) P.lab = t[1];
else throw new Error('unknown part option ' + t);
}
if (o) { if (o.label) P.labxy = o.label; if (o.text) P.text = o.text; if (o.box) P.box = o.box; }
return P;
}
// Box symbols (connectors, ICs): spec {w, h, title, pins: [[name, side L|R|T|B, offset, [nums]]]}
function boxSym(spec) {
const pins = {}, map = {}, d = [], txt = [];
const hw = spec.w / 2, hh = spec.h / 2;
for (const [name, side, off, nums] of spec.pins) {
let p, q, t, anchor;
if (side === 'L') { p = [-hw - 10, -hh + off]; q = [-hw, -hh + off]; t = [-hw + 4, -hh + off + 3]; anchor = 'start'; }
else if (side === 'R') { p = [hw + 10, -hh + off]; q = [hw, -hh + off]; t = [hw - 4, -hh + off + 3]; anchor = 'end'; }
else if (side === 'T') { p = [-hw + off, -hh - 10]; q = [-hw + off, -hh]; t = [-hw + off, -hh + 11]; anchor = 'middle'; }
else { p = [-hw + off, hh + 10]; q = [-hw + off, hh]; t = [-hw + off, hh - 5]; anchor = 'middle'; }
pins[name] = p; map[name] = nums;
d.push('M' + p[0] + ',' + p[1] + 'L' + q[0] + ',' + q[1]);
txt.push([t[0], t[1], name, anchor]);
}
d.push('M' + -hw + ',' + -hh + 'h' + spec.w + 'v' + spec.h + 'h' + -spec.w + 'z');
return { sym: { pins, d: d.join(''), bb: [-hw, -hh, hw, hh], boxText: txt, title: spec.title }, map };
}
// ------------------------------------------------------------------ analysis (placement + connectivity + checks)
function analyze(block, design) {
const errors = [], warns = [];
const err = (m) => errors.push(block.id + ': ' + m);
const parts = [], pinAt = {}; // pinAt['Q301.b'] = {x, y, ref, nums, key}
for (const entry of block.parts || []) {
const [key, x, y, opt, obj] = entry;
let ref = key, unit = null;
if (!design.parts[ref] && /[AB]$/.test(key) && design.parts[key.slice(0, -1)]) { ref = key.slice(0, -1); unit = key.slice(-1); }
const dp = design.parts[ref];
if (!dp) { err('unknown part ' + key); continue; }
let P;
try { P = parseOpts(opt, obj); } catch (e) { err(key + ': ' + e.message); continue; }
P.x = x; P.y = y;
let symName, sym, map, hidden = [];
if (P.box) { const b = boxSym(P.box); sym = b.sym; map = b.map; symName = 'BOX'; }
else {
const lib = LIB[dp.lib];
if (!lib) { err(key + ': no symbol for ' + dp.lib + ' (pass a box spec)'); continue; }
symName = lib[0]; sym = SYM[symName]; map = lib[1]; hidden = lib[2] || [];
if (map.A) {
if (!unit) { err(key + ': ' + dp.lib + ' needs a unit suffix (A/B)'); continue; }
map = map[unit];
}
}
const part = { key, ref, unit, dp, P, symName, sym, map, hidden, pins: {} };
for (const [pn, lp] of Object.entries(sym.pins)) {
const nums = map[pn];
if (!nums) { err(key + ': symbol pin ' + pn + ' has no part pin'); continue; }
const nets = new Set(nums.map((n) => dp.pins[n]));
if (nums.some((n) => !(n in dp.pins))) err(key + '.' + pn + ': part has no pin ' + nums.join('/'));
if (nets.size > 1) err(key + '.' + pn + ': pins ' + nums.join('/') + ' are on different nets ' + [...nets].join(', '));
const pos = xf(lp, P);
const info = { x: pos[0], y: pos[1], key, ref, pin: pn, nums, net: dp.pins[nums[0]] };
part.pins[pn] = info;
pinAt[key + '.' + pn] = info;
}
parts.push(part);
}
const pt = (item) => {
if (Array.isArray(item)) {
if (item.length !== 2 || !Number.isFinite(item[0]) || !Number.isFinite(item[1])) { err('bad point ' + JSON.stringify(item)); return null; }
return item;
}
const p = pinAt[item];
if (!p) { err('unknown pin ' + item); return null; }
return [p.x, p.y];
};
// wires -> polylines (absolute points)
const wires = [];
for (const w of block.wires || []) {
const pts = [];
let route = 'hv';
let ok = true;
for (const item of w) {
if (item === 'hv' || item === 'vh') { route = item; continue; }
const q = pt(item);
if (!q) { ok = false; break; }
if (pts.length) {
const p = pts[pts.length - 1];
if (p[0] !== q[0] && p[1] !== q[1]) pts.push(route === 'hv' ? [q[0], p[1]] : [p[0], q[1]]);
}
pts.push(q);
route = 'hv';
}
if (ok && pts.length >= 2) wires.push({ pts, src: w });
else if (ok) err('wire with one point: ' + JSON.stringify(w));
}
// anchors: ground, rails, flags
const anchors = [];
const dirOf = (a, d) => a || d;
for (const g of block.gnd || []) {
const [at, dir] = Array.isArray(g) && typeof g[1] === 'string' ? g : [g, null];
const p = pt(at); if (p) anchors.push({ kind: 'gnd', name: 'GND', p, dir: dirOf(dir, 'down') });
}
for (const [at, name, dir] of block.rails || []) { const p = pt(at); if (p) anchors.push({ kind: 'rail', name, p, dir: dir || 'up' }); }
for (const [at, name, dir] of block.flags || []) { const p = pt(at); if (p) anchors.push({ kind: 'flag', name, p, dir: dir || 'right' }); }
// union-find over point keys
const parent = {};
const find = (a) => { while (parent[a] !== a) { parent[a] = parent[parent[a]]; a = parent[a]; } return a; };
const add = (a) => { if (!(a in parent)) parent[a] = a; };
const union = (a, b) => { add(a); add(b); parent[find(a)] = find(b); };
const segs = [];
wires.forEach((w, wi) => {
for (let i = 0; i < w.pts.length; i++) add(K(w.pts[i]));
for (let i = 1; i < w.pts.length; i++) { union(K(w.pts[i - 1]), K(w.pts[i])); segs.push({ a: w.pts[i - 1], b: w.pts[i], wi }); }
});
const keyPts = [];
for (const w of wires) for (const p of w.pts) keyPts.push(p);
for (const p of Object.values(pinAt)) { add(K([p.x, p.y])); keyPts.push([p.x, p.y]); }
for (const a of anchors) { add(K(a.p)); keyPts.push(a.p); }
const onSeg = (p, s) => { // strictly inside an axis-aligned segment
const [x, y] = p, [ax, ay] = s.a, [bx, by] = s.b;
if (ax === bx) return x === ax && y > Math.min(ay, by) && y < Math.max(ay, by);
if (ay === by) return y === ay && x > Math.min(ax, bx) && x < Math.max(ax, bx);
return false;
};
const tees = {};
for (const s of segs) {
for (const p of keyPts) if (onSeg(p, s)) { union(K(p), K(s.a)); tees[K(p)] = (tees[K(p)] || 0) + 2; }
}
for (let i = 0; i < segs.length; i++) for (let j = i + 1; j < segs.length; j++) { // collinear overlap
const s = segs[i], t = segs[j];
if (s.wi === t.wi) continue;
const vert = s.a[0] === s.b[0] && t.a[0] === t.b[0] && s.a[0] === t.a[0];
const hor = s.a[1] === s.b[1] && t.a[1] === t.b[1] && s.a[1] === t.a[1];
if (!vert && !hor) continue;
const ix = vert ? 1 : 0;
const lo = Math.max(Math.min(s.a[ix], s.b[ix]), Math.min(t.a[ix], t.b[ix]));
const hi = Math.min(Math.max(s.a[ix], s.b[ix]), Math.max(t.a[ix], t.b[ix]));
if (hi > lo) { union(K(s.a), K(t.a)); warns.push(block.id + ': overlapping wires at ' + K(s.a) + ' / ' + K(t.a)); }
}
// group contents
const groups = {};
const G = (k) => (groups[find(k)] = groups[find(k)] || { pins: [], names: new Set(), ends: 0 });
for (const p of Object.values(pinAt)) G(K([p.x, p.y])).pins.push(p);
for (const a of anchors) G(K(a.p)).names.add(a.name);
const degree = {};
const bump = (k, n) => { degree[k] = (degree[k] || 0) + n; };
for (const w of wires) {
for (let i = 0; i < w.pts.length; i++) {
const k = K(w.pts[i]);
G(k).ends++;
bump(k, i === 0 || i === w.pts.length - 1 ? 1 : 2);
}
}
for (const p of Object.values(pinAt)) bump(K([p.x, p.y]), 1);
for (const a of anchors) bump(K(a.p), 1);
for (const [k, n] of Object.entries(tees)) bump(k, n);
const netOfGroup = {};
for (const [root, g] of Object.entries(groups)) {
const nets = new Set(g.pins.map((p) => p.net));
for (const n of g.names) nets.add(n);
const real = [...nets];
if (real.includes(null) || real.includes(undefined)) {
if (g.pins.length > 1 || g.ends || g.names.size) err('no-connect pin wired: ' + g.pins.filter((p) => p.net == null).map((p) => p.key + '.' + p.pin).join(', '));
}
const named = real.filter((n) => n != null);
if (named.length > 1) err('short: ' + named.join(' + ') + ' joined at ' + g.pins.map((p) => p.key + '.' + p.pin).concat([...g.names]).join(', '));
netOfGroup[root] = named[0] || null;
if (g.pins.length === 1 && !g.ends && !g.names.size && g.pins[0].net != null) err('unconnected pin ' + g.pins[0].key + '.' + g.pins[0].pin + ' (' + g.pins[0].net + ')');
if (!g.pins.length && !g.names.size && g.ends) err('floating wire near ' + root);
}
// dangling wire ends
for (const w of wires) for (const p of [w.pts[0], w.pts[w.pts.length - 1]]) {
if ((degree[K(p)] || 0) < 2) err('dangling wire end at ' + K(p));
}
const netAt = (p) => netOfGroup[find(K(p))] || null;
const junctions = Object.keys(degree).filter((k) => degree[k] >= 3).map((k) => k.split(',').map(Number));
return { errors, warns, parts, wires, anchors, junctions, netAt, pinAt };
}
// ------------------------------------------------------------------ rendering
function partLabel(part) {
const { P, sym, symName, dp, key } = part;
if (P.lab === 'n') return '';
const ref = key, val = symName === 'TP' || symName === 'MC' ? '' : (P.text && symName.startsWith('CF') ? '' : dp.value);
const lines = [];
const vertical = (P.rot === 90 || P.rot === 270);
let x, y, anchor, stack = true;
if (P.labxy) { x = P.x + P.labxy[0]; y = P.y + P.labxy[1]; anchor = P.labxy[2] || 'start'; stack = P.labxy[3] !== 'line'; }
else if (sym.tp) {
const tip = xf([0, -19], P);
const dx = tip[0] - P.x, dy = tip[1] - P.y;
x = tip[0]; y = tip[1] + (dy > 0 ? 8 : dy < 0 ? -1 : 3);
anchor = dx > 0 ? 'start' : dx < 0 ? 'end' : 'middle';
return '<text class="tpl' + (sym.mc ? ' mcl' : '') + '" x="' + x + '" y="' + y + '" text-anchor="' + anchor + '">' + esc(dp.value) + '</text>';
} else if (TWO_TERM.has(symName)) {
const side = P.lab || (vertical ? 'r' : 't');
if (side === 't') { x = P.x; y = P.y - 10; anchor = 'middle'; stack = false; if (symName === 'LED') y -= 6; }
else if (side === 'b') { x = P.x; y = P.y + 17; anchor = 'middle'; stack = false; }
else if (side === 'r') { x = P.x + 9; y = P.y - 1; anchor = 'start'; }
else { x = P.x - 9; y = P.y - 1; anchor = 'end'; }
} else if (symName === 'NPN' || symName === 'PNP') {
const side = P.lab || (P.mx !== (P.rot === 180) ? 'l' : 'r');
if (side === 'l') { x = P.x - 17; anchor = 'end'; } else { x = P.x + 20; anchor = 'start'; }
y = P.y - 2;
if (side === 't') { x = P.x; y = P.y - 26; anchor = 'middle'; stack = false; }
if (side === 'b') { x = P.x; y = P.y + 34; anchor = 'middle'; stack = false; }
} else if (symName === 'OPAMP') {
x = P.x; y = P.y - 27; anchor = 'middle'; stack = false;
if (P.lab === 'b') y = P.y + 34;
return '<text class="ref" x="' + x + '" y="' + y + '" text-anchor="middle">' + esc(key) + '</text>';
} else if (symName === 'CF3' || symName === 'CF4') {
x = P.x; y = P.y - 13; anchor = 'middle';
if (P.lab === 'b') y = P.y + 32;
return '<text class="ref" x="' + x + '" y="' + y + '" text-anchor="middle">' + esc(key) + '</text>';
} else if (symName === 'BAT54S') { x = P.x; y = P.y + 18; anchor = 'middle'; stack = false; }
else if (symName === 'COAX') { x = P.x - 13; y = P.y - 2; anchor = 'end'; }
else if (symName === 'BOX') { return ''; }
else { x = P.x + 12; y = P.y; anchor = 'start'; }
if (stack) {
return '<text class="ref" x="' + x + '" y="' + y + '" text-anchor="' + anchor + '">' + esc(ref) + '</text>' +
(val ? '<text class="val" x="' + x + '" y="' + (y + 10.5) + '" text-anchor="' + anchor + '">' + esc(val) + '</text>' : '');
}
return '<text x="' + x + '" y="' + y + '" text-anchor="' + anchor + '"><tspan class="ref">' + esc(ref) + '</tspan>' +
(val ? ' <tspan class="val">' + esc(val) + '</tspan>' : '') + '</text>';
}
function drawPart(part) {
const { P, sym, key, ref, symName } = part;
const tr = 'translate(' + P.x + ',' + P.y + ')' + (P.rot ? ' rotate(' + P.rot + ')' : '') + (P.mx || P.my ? ' scale(' + (P.mx ? -1 : 1) + ',' + (P.my ? -1 : 1) + ')' : '');
let g = '<g class="sym" transform="' + tr + '">';
if (sym.circle) g += '<circle class="body" cx="' + sym.circle[0] + '" cy="' + sym.circle[1] + '" r="' + sym.circle[2] + '"/>';
g += '<path d="' + sym.d + '"/>';
if (sym.f) g += '<path class="fill" d="' + sym.f + '"/>';
for (const dt of sym.dots || []) g += '<circle class="dot" cx="' + dt[0] + '" cy="' + dt[1] + '" r="2.2"/>';
g += '</g>';
if (sym.boxText) {
for (const [tx, ty, s, an] of sym.boxText) g += '<text class="pinname" x="' + (P.x + tx) + '" y="' + (P.y + ty) + '" text-anchor="' + an + '">' + esc(s) + '</text>';
if (sym.title) {
const t = Array.isArray(sym.title) ? sym.title : [sym.title];
t.forEach((s, i) => { g += '<text class="' + (i ? 'val' : 'ref') + '" x="' + P.x + '" y="' + (P.y + sym.bb[1] - 6 - (t.length - 1 - i) * 11) + '" text-anchor="middle">' + esc(s) + '</text>'; });
}
}
if (P.text) g += '<text class="inner" x="' + P.x + '" y="' + (P.y + 3) + '" text-anchor="middle">' + esc(P.text) + '</text>';
const b = bbox(sym.bb, P);
const pad = 4;
g += '<rect class="hit" x="' + (b[0] - pad) + '" y="' + (b[1] - pad) + '" width="' + (b[2] - b[0] + 2 * pad) + '" height="' + (b[3] - b[1] + 2 * pad) + '"/>';
const cls = 'part' + (sym.tp ? (sym.mc ? ' mc' : ' tp') : '');
return '<g class="' + cls + '" data-ref="' + esc(ref) + '" data-key="' + esc(key) + '">' + g + partLabel(part) + '</g>';
}
function drawAnchor(a, net) {
const [x, y] = a.p, n = esc(net || a.name);
if (a.kind === 'gnd') {
const v = { down: [0, 1], up: [0, -1], left: [-1, 0], right: [1, 0] }[a.dir];
const px = (s, t) => [x + v[0] * s + v[1] * t, y + v[1] * s + v[0] * t];
const L = (s, t1, t2) => { const p = px(s, t1), q = px(s, t2); return 'M' + p[0] + ',' + p[1] + 'L' + q[0] + ',' + q[1]; };
const e = px(6, 0);
return '<path class="gnd" data-net="GND" d="M' + x + ',' + y + 'L' + e[0] + ',' + e[1] + L(6, -7, 7) + L(9, -4.5, 4.5) + L(12, -2, 2) + '"/>';
}
if (a.kind === 'rail') {
const tw = a.name.length * CW;
let d, tx, ty, an;
if (a.dir === 'up') { d = 'M' + x + ',' + y + 'V' + (y - 9) + 'M' + (x - 6) + ',' + (y - 9) + 'H' + (x + 6); tx = x; ty = y - 13; an = 'middle'; }
else if (a.dir === 'down') { d = 'M' + x + ',' + y + 'V' + (y + 9) + 'M' + (x - 6) + ',' + (y + 9) + 'H' + (x + 6); tx = x; ty = y + 20; an = 'middle'; }
else if (a.dir === 'right') { d = 'M' + x + ',' + y + 'H' + (x + 9) + 'M' + (x + 9) + ',' + (y - 6) + 'V' + (y + 6); tx = x + 13; ty = y + 3.5; an = 'start'; }
else { d = 'M' + x + ',' + y + 'H' + (x - 9) + 'M' + (x - 9) + ',' + (y - 6) + 'V' + (y + 6); tx = x - 13; ty = y + 3.5; an = 'end'; }
void tw;
return '<g class="rail" data-net="' + n + '"><path d="' + d + '"/><text x="' + tx + '" y="' + ty + '" text-anchor="' + an + '">' + esc(a.name) + '</text></g>';
}
// flag
const tw = a.name.length * CW + 10, h = 7;
let pts, tx, ty;
if (a.dir === 'right') { pts = [[x, y], [x + 6, y - h], [x + 6 + tw, y - h], [x + 6 + tw, y + h], [x + 6, y + h]]; tx = x + 6 + tw / 2; ty = y + 3.3; }
else if (a.dir === 'left') { pts = [[x, y], [x - 6, y - h], [x - 6 - tw, y - h], [x - 6 - tw, y + h], [x - 6, y + h]]; tx = x - 6 - tw / 2; ty = y + 3.3; }
else if (a.dir === 'up') { pts = [[x, y], [x + h, y - 6], [x + h, y - 6 - tw], [x - h, y - 6 - tw], [x - h, y - 6]]; tx = x; ty = y - 6 - tw / 2; }
else { pts = [[x, y], [x + h, y + 6], [x + h, y + 6 + tw], [x - h, y + 6 + tw], [x - h, y + 6]]; tx = x; ty = y + 6 + tw / 2; }
const vert = a.dir === 'up' || a.dir === 'down';
return '<g class="flag" data-net="' + n + '" tabindex="0" role="button"><path d="M' + pts.map((p) => p.join(',')).join('L') + 'Z"/>' +
'<text x="' + tx + '" y="' + ty + '" text-anchor="middle"' + (vert ? ' transform="rotate(-90 ' + tx + ' ' + ty + ')" dy="3.3"' : '') + '>' + esc(a.name) + '</text></g>';
}
function render(block, design, opts) {
opts = opts || {};
const A = analyze(block, design);
const out = [];
const W = block.w, H = block.h;
out.push('<svg class="sch" viewBox="0 0 ' + W + ' ' + H + '" width="' + W + '" height="' + H + '" data-block="' + esc(block.id) + '" xmlns="http://www.w3.org/2000/svg">');
if (opts.style) out.push('<style>' + opts.style + '</style>');
out.push('<g class="boxes">');
for (const [x, y, w, h, title] of block.boxes || []) {
out.push('<rect class="region" x="' + x + '" y="' + y + '" width="' + w + '" height="' + h + '" rx="4"/>');
if (title) out.push('<text class="region-t" x="' + (x + 4) + '" y="' + (y - 4) + '">' + esc(title) + '</text>');
}
out.push('</g><g class="wires">');
for (const w of A.wires) {
const net = A.netAt(w.pts[0]);
const d = 'M' + w.pts.map((p) => p.join(',')).join('L');
out.push('<path class="wire" data-net="' + esc(net || '') + '" d="' + d + '"/><path class="wire-hit" data-net="' + esc(net || '') + '" d="' + d + '"/>');
}
for (const j of A.junctions) out.push('<circle class="junction" data-net="' + esc(A.netAt(j) || '') + '" cx="' + j[0] + '" cy="' + j[1] + '" r="2.6"/>');
out.push('</g><g class="anchors">');
for (const a of A.anchors) out.push(drawAnchor(a, A.netAt(a.p)));
out.push('</g><g class="parts">');
for (const p of A.parts) out.push(drawPart(p));
out.push('</g><g class="notes">');
for (const [x, y, s, an] of block.notes || []) {
String(s).split('\n').forEach((line, i) => out.push('<text class="note" x="' + x + '" y="' + (y + i * 11) + '" text-anchor="' + (an || 'start') + '">' + esc(line) + '</text>'));
}
out.push('</g></svg>');
return { svg: out.join(''), analysis: A };
}
return { SYM, LIB, analyze, render, xf };
});
var SCH = self.SCH;
var SCH_BLOCKS = [];
// Sheet 4: AM front end, up-conversion to 10.7 MHz (tools/design.py lines 517-563)
SCH_BLOCKS.push({
id: 'amrf', sheet: 'amfe', w: 500, h: 360,
parts: [
['R401', 90, 220, 'r90'],
['TP403', 90, 200],
['C401', 130, 200],
['Q401', 190, 200],
['R403', 160, 150, 'r90'],
['R404', 160, 240, 'r90'],
['R405', 200, 250, 'r90'],
['R406', 200, 310, 'r90', 'll'],
['C404', 240, 310, 'r90'],
['R407', 200, 110, 'r90'],
['TP404', 250, 150],
['C405', 330, 150],
['R402', 420, 60, 'r180'],
['C402', 290, 90, 'r90'],
['C403', 340, 90, 'r90'],
['TP401', 240, 60],
],
wires: [
[[70, 200], 'C401.1'],
['C401.2', 'Q401.b'],
['R403.2', [160, 200]], ['R404.1', [160, 200]],
['Q401.e', 'R405.1'],
['R405.2', 'R406.1'], [[200, 280], [240, 280], 'C404.1'],
['Q401.c', 'R407.2'],
[[200, 150], 'C405.1'],
['R403.1', [160, 60], 'R402.2'],
['R407.1', [200, 60]],
['C402.1', [290, 60]], ['C403.1', [340, 60]],
],
gnd: ['R401.2', 'R404.2', 'R406.2', 'C404.2', 'C402.2', 'C403.2'],
rails: [['R402.1', '+5V_AM', 'right']],
flags: [[[70, 200], 'AM_RFIN', 'left'], ['C405.2', 'AM_MIX_B', 'right']],
notes: [[170, 54, 'V_AM1'], [20, 290, 'R401: 51 Ω load\nfor the AM low-pass'], [290, 290, 'gain ~24 dB: R407 over\nthe unbypassed R405']],
});
SCH_BLOCKS.push({
id: 'amlo', sheet: 'amfe', w: 550, h: 350,
parts: [
['R412', 80, 260],
['C411', 120, 230, 'r90'],
['D401', 120, 290, 'r90'],
['C410', 170, 230, 'r90'],
['L401', 210, 190, 'r180'],
['R409', 260, 130, 'r90'],
['R410', 260, 240, 'r90'],
['C408', 310, 230, 'r90'],
['C409', 310, 290, 'r90'],
['Q402', 370, 190],
['R411', 380, 290, 'r90'],
['TP405', 410, 240],
['C412', 450, 240],
['C406', 160, 90, 'r90'],
['C407', 210, 90, 'r90'],
['TP402', 320, 60],
['R408', 450, 60, 'r180'],
],
wires: [
['R412.2', [120, 260]],
['C411.2', 'D401.k'],
['C411.1', [120, 190], 'L401.2'],
['C410.1', [170, 190]],
['L401.1', 'Q402.b'],
['R409.2', [260, 190]], ['R410.1', [260, 190]],
['C408.1', [310, 190]],
['C408.2', 'C409.1'], [[310, 260], [380, 260]],
['Q402.e', 'R411.1'],
[[380, 240], 'C412.1'],
['C406.1', [160, 60], 'R408.2'],
['C407.1', [210, 60]], ['R409.1', [260, 60]],
['Q402.c', [380, 60]],
],
gnd: ['D401.a', 'C410.2', 'R410.2', 'C409.2', 'R411.2', 'C406.2', 'C407.2'],
rails: [['R408.1', '+5V_AM', 'right']],
flags: [['R412.1', 'VT_AM', 'left'], ['C412.2', 'AM_MIX_B', 'right']],
notes: [[170, 54, 'V_AM2'], [20, 145, 'Clapp: L401 in series with\nC410 and the varactor'], [425, 290, 'C408 / C409:\nfeedback divider;\noutput at the emitter']],
});
SCH_BLOCKS.push({
id: 'ammix', sheet: 'amfe', w: 420, h: 290,
parts: [
['Q403', 200, 170],
['R413', 140, 120, 'r90'],
['R414', 140, 220, 'r90'],
['R415', 210, 230, 'r90', 'll'],
['C413', 250, 230, 'r90'],
['TP406', 310, 250],
],
wires: [
[[80, 170], 'Q403.b'],
['R413.2', [140, 170]], ['R414.1', [140, 170]],
['Q403.e', 'R415.1'], [[210, 200], [250, 200], 'C413.1'],
['Q403.c', [210, 110], [310, 110]],
],
gnd: ['R414.2', 'R415.2', 'C413.2', 'TP406.p'],
rails: [['R413.1', '+5V_AM', 'up']],
flags: [[[80, 170], 'AM_MIX_B', 'left'], [[310, 110], 'IF_MIX', 'right']],
notes: [[20, 195, 'RF in via C405\nLO in via C412'], [228, 140, 'difference product\nat 10.7 MHz'], [300, 76, 'load: R501 330 Ω\n(shared with FM)']],
});
// Sheet 6: AM 455 kHz IF, AGC & envelope detector (tools/design.py lines 627-702)
SCH_BLOCKS.push({
id: 'amf', sheet: 'amif', w: 480, h: 310,
parts: [
// supplies: +5VA -> 22 ohm -> V_IF3 bus; V_IF3 -> 6.8k/10k -> VBIAS bus
['R602', 80, 50],
['C603', 130, 90, 'r90'], ['C604', 180, 90, 'r90'],
['TP601', 440, 50],
['R603', 280, 90, 'r90'], ['R604', 280, 160, 'r90'],
['C605', 330, 160, 'r90'], ['C606', 380, 160, 'r90'],
['TP602', 440, 130],
// signal: IF2_OUT -> C601 -> FL601 -> termination -> C602 -> VGA1_IN
['C601', 100, 230],
['FL601', 170, 230, '', { text: '455k' }],
['R601', 240, 260, 'r90'],
['TP603', 280, 230],
['C602', 330, 230],
['TP610', 440, 280],
],
wires: [
['R602.2', [440, 50]],
['C603.1', [130, 50]], ['C604.1', [180, 50]], ['R603.1', [280, 50]],
['R603.2', 'R604.1'],
[[280, 130], [440, 130]],
['C605.1', [330, 130]], ['C606.1', [380, 130]],
['C601.2', 'FL601.in'],
['FL601.g1', [162, 260], [178, 260], 'FL601.g2'],
['FL601.out', 'C602.1'],
['R601.1', [240, 230]],
],
gnd: ['C603.2', 'C604.2', 'R604.2', 'C605.2', 'C606.2', [[170, 260], 'down'], 'R601.2', 'TP610.p'],
rails: [['R602.1', '+5VA', 'left']],
flags: [['C601.1', 'IF2_OUT', 'left'], ['C602.2', 'VGA1_IN', 'right']],
notes: [[300, 44, 'V_IF3: AM IF supply'], [300, 124, 'VBIAS ≈ 2.9 V'], [200, 300, 'R601 ∥ VGA input ≈ 2 kΩ termination']],
});
SCH_BLOCKS.push({
id: 'vga', sheet: 'amif', w: 610, h: 320,
parts: [
// stage 1
['R605', 90, 120, 'r90'],
['Q601A', 150, 160, '', { label: [-17, 22, 'end'] }],
['Q601B', 230, 160, 'mx', { label: [17, 22, 'start'] }],
['R606', 220, 100, 'r90'],
['Q602', 200, 220, 'mx', { label: [-21, -2, 'end'] }],
['R607', 190, 270, 'r90'],
['TP604', 270, 130],
['C608', 310, 130],
// stage 2
['R610', 350, 90, 'r90'],
['Q603A', 400, 160, '', { label: [-17, 22, 'end'] }],
['Q603B', 480, 160, 'mx', { label: [17, 22, 'start'] }],
['R611', 470, 100, 'r90'],
['Q604', 430, 220],
['R612', 440, 270, 'r90'],
['TP605', 520, 130],
// AGC_B = V_AGC / 2
['R609', 260, 250, 'r90'],
['C607', 310, 250, 'r90'],
['R608', 360, 250, 'r270'],
],
wires: [
// stage 1
[[60, 160], 'Q601A.b'], ['R605.2', [90, 160]],
['Q601A.c', [160, 60], [220, 60], 'R606.1'],
['R606.2', 'Q601B.c'],
['Q601A.e', [160, 200], [220, 200], 'Q601B.e'],
['Q602.e', 'R607.1'],
[[220, 130], 'C608.1'],
// stage 2
['C608.2', [350, 130], [350, 160], 'Q603A.b'], ['R610.2', [350, 130]],
['Q603A.c', [410, 60], [470, 60], 'R611.1'],
['R611.2', 'Q603B.c'],
['Q603A.e', [410, 200], [470, 200], 'Q603B.e'],
['Q604.e', 'R612.1'],
[[470, 130], [540, 130]],
// tail bias
['Q602.b', 'Q604.b'],
['R609.1', [260, 220]], ['C607.1', [310, 220]], ['R608.2', [360, 220]],
['R608.1', [360, 290]],
],
gnd: ['R607.2', 'R612.2', 'R609.2', 'C607.2'],
rails: [
[[190, 60], 'V_IF3', 'up'], [[440, 60], 'V_IF3', 'up'],
['R605.1', 'VBIAS', 'up'], ['R610.1', 'VBIAS', 'up'],
['Q601B.b', 'VBIAS', 'right'], ['Q603B.b', 'VBIAS', 'right'],
],
flags: [[[60, 160], 'VGA1_IN', 'left'], [[540, 130], 'VGA2_OUT', 'right'], [[360, 290], 'V_AGC', 'right']],
notes: [[20, 250, 'gain set by the\ntail current:\n0.9 mA → ×19\n10 µA → ×0.2'], [220, 305, 'AGC_B = V_AGC / 2']],
});
SCH_BLOCKS.push({
id: 'det', sheet: 'amif', w: 590, h: 330,
parts: [
['C609', 100, 170],
['Q605', 190, 170],
['R613', 140, 110, 'r90'],
['R614', 140, 220, 'r90'],
['R617', 200, 90, 'r90'],
['R615', 200, 220, 'r90'],
['R616', 200, 280, 'r90', 'll'],
['C610', 240, 280, 'r90'],
['TP606', 240, 130],
['C611', 290, 130],
['R618', 330, 160, 'r90'],
['D601', 370, 130, 'r180'],
['C612', 420, 160, 'r90'],
['R619', 470, 160, 'r90'],
['MC22', 510, 130],
['TP611', 540, 290],
],
wires: [
['C609.2', 'Q605.b'],
['R613.2', [140, 170], 'R614.1'],
['R613.1', [140, 50], [200, 50], 'R617.1'],
['R617.2', 'Q605.c'],
['Q605.e', 'R615.1'],
['R615.2', 'R616.1'], [[200, 250], [240, 250], 'C610.1'],
[[200, 130], 'C611.1'],
['C611.2', 'D601.a'], ['R618.1', [330, 130]],
['D601.k', [530, 130]],
['C612.1', [420, 130]], ['R619.1', [470, 130]],
],
gnd: ['R614.2', 'R616.2', 'C610.2', 'R618.2', 'C612.2', 'R619.2', 'TP611.p'],
rails: [[[170, 50], 'V_IF3', 'up']],
flags: [['C609.1', 'VGA2_OUT', 'left'], [[530, 130], 'AM_DET', 'right']],
notes: [[250, 210, 'post-amp:\nIc ≈ 1.1 mA,\ngain ≈ 30'], [390, 215, 'envelope detector:\nC612 · R619 = 22 µs']],
});
SCH_BLOCKS.push({
id: 'agc', sheet: 'amif', w: 620, h: 400,
parts: [
// AGC integrator U601A: inverting PI integrator of AM_DET against AGC_REF
['R620', 140, 100],
['U601A', 240, 110],
['C614', 200, 60, 'r180'],
['R623', 260, 60, 'r180'],
['R621', 130, 160],
['R622', 170, 190, 'r90', 'll'],
['C613', 240, 190, 'r90'],
['TP607', 360, 110],
['R624', 320, 140, 'r90'],
['R625', 320, 200, 'r90'],
['C615', 370, 200, 'r90'],
['TP608', 400, 170],
['C620', 560, 90, 'r90'],
// AM audio: AC coupling, re-bias to VREF_1V65, unity-gain Sallen-Key 5 kHz low-pass
['C616', 120, 310],
['R626', 160, 340, 'r90'],
['R627', 200, 310],
['R628', 270, 310],
['C617', 300, 260],
['C618', 310, 340, 'r90', 'll'],
['U601B', 370, 320, 'my'],
['TP609', 380, 260],
['R629', 460, 320],
['C619', 500, 350, 'r90'],
['MC15', 530, 320],
],
wires: [
['R620.1', [60, 100], [60, 310], 'C616.1'],
['R620.2', 'U601A.-'],
['C614.2', [180, 100]],
['C614.1', 'R623.2'],
['R623.1', [280, 110]],
['U601A.o', [420, 110]],
['U601A.+', [200, 120], [200, 160]],
['R621.2', [240, 160], 'C613.1'],
['R622.1', [170, 160]],
['R624.1', [320, 110]],
['R624.2', 'R625.1'],
[[320, 170], [420, 170]],
['C615.1', [370, 170]],
// audio
['C616.2', 'R627.1'], ['R626.1', [160, 310]], ['R626.2', [160, 370], [140, 370]],
['R627.2', 'R628.1'],
['C617.1', [240, 260], [240, 310]],
['R628.2', 'U601B.+'], ['C618.1', [310, 310]],
['U601B.o', 'R629.1'],
['C617.2', [430, 260], [430, 320]],
['U601B.-', [340, 350], [410, 350], [410, 320]],
['R629.2', [550, 320]],
['C619.1', [500, 320]],
],
gnd: ['R622.2', 'C613.2', 'R625.2', 'C615.2', 'C620.2', 'C618.2', 'C619.2'],
rails: [['R621.1', 'V_IF3', 'left'], ['C620.1', '+5VA', 'up']],
flags: [
[[60, 200], 'AM_DET', 'left'],
[[420, 110], 'V_AGC', 'right'], [[420, 170], 'RSSI_AM', 'right'],
[[140, 370], 'VREF_1V65', 'left'], [[550, 320], 'AM_AUDIO', 'right'],
],
notes: [[520, 140, 'U601: +5VA / GND'], [75, 245, 'integrator: holds AM_DET\nat AGC_REF ≈ 1 V'], [330, 385, '5 kHz Sallen-Key, gain 1']],
});
// Sheet 3: antenna, diplexer & FM front end (tools/design.py lines 441-514)
SCH_BLOCKS.push({
id: 'ant', sheet: 'fmfe', w: 440, h: 340,
parts: [
['J301', 40, 160, '', { label: [0, -24, 'middle'] }],
['MC18', 76, 160],
['R301', 110, 180, 'r90'],
['C323', 150, 160, 'r180'],
['R317', 210, 160, 'r180'],
['TP110', 250, 160],
// AM leg: 5-pole low-pass, series L first
['L301', 130, 60], ['C301', 170, 90, 'r90'], ['L302', 210, 60], ['C302', 250, 90, 'r90'], ['L303', 290, 60],
// FM leg: 3-pole high-pass (series C first), then 3-pole low-pass
['C303', 130, 250], ['L304', 170, 280, 'r90'], ['C304', 210, 250],
['C305', 250, 280, 'r90'], ['L305', 290, 250], ['C306', 330, 280, 'r90'],
],
wires: [
['J301.sig', [90, 160]],
[[90, 160], [90, 60], 'L301.1'],
['L301.2', 'L302.1'], ['C301.1', [170, 60]],
['L302.2', 'L303.1'], ['C302.1', [250, 60]],
[[90, 160], [90, 250], 'C303.1'],
['C303.2', 'C304.1'], ['L304.1', [170, 250]],
['C304.2', 'L305.1'], ['C305.1', [250, 250]],
['L305.2', [360, 250]], ['C306.1', [330, 250]],
['C323.2', [90, 160]],
['C323.1', 'R317.2'],
['R317.1', [280, 160]],
],
gnd: ['J301.sh', 'R301.2', 'C301.2', 'C302.2', 'L304.2', 'C305.2', 'C306.2'],
flags: [['L303.2', 'AM_RFIN', 'right'], [[360, 250], 'FM_BPF', 'right'], [[280, 160], 'CAL_MARK', 'right']],
boxes: [[100, 35, 225, 100, 'AM: 2 MHz low-pass, 5 poles'], [100, 225, 140, 100, 'FM: 70 MHz high-pass'], [242, 225, 105, 100, '130 MHz low-pass']],
});
SCH_BLOCKS.push({
id: 'fmrf', sheet: 'fmfe', w: 520, h: 360,
parts: [
['R302', 60, 220, 'r90'],
['C307', 100, 200],
['Q301', 160, 200],
['R303', 130, 150, 'r90'],
['R304', 130, 240, 'r90'],
['R305', 170, 250, 'r90'],
['R306', 170, 310, 'r90', 'll'],
['C308', 200, 310, 'r90'],
['L306', 170, 110, 'r270 ll'],
['C309', 240, 180, 'r90'],
['C310', 300, 180, 'r90'],
['D301', 300, 240, 'r90'],
['R307', 350, 210, 'r180'],
['C313', 410, 150],
['R308', 360, 60, 'r180'],
['C311', 250, 90, 'r90'],
['C312', 300, 90, 'r90'],
['TP301', 210, 60],
],
wires: [
[[40, 200], 'C307.1'], ['R302.1', [60, 200]],
['C307.2', 'Q301.b'],
['R303.2', [130, 200]], ['R304.1', [130, 200]],
['Q301.e', 'R305.1'],
['R305.2', 'R306.1'], [[170, 280], [200, 280], 'C308.1'],
['Q301.c', 'L306.1'],
[[170, 150], 'C313.1'],
['C309.1', [240, 150]], ['C310.1', [300, 150]],
['C310.2', 'D301.k'], ['R307.2', [300, 210]],
['R303.1', [130, 60], 'R308.2'],
['L306.2', [170, 60]], ['C311.1', [250, 60]], ['C312.1', [300, 60]],
],
gnd: ['R302.2', 'R304.2', 'R306.2', 'C308.2', 'C309.2', 'D301.a', 'C311.2', 'C312.2'],
rails: [['R308.1', '+5V_FM', 'right']],
flags: [[[40, 200], 'FM_BPF', 'left'], ['R307.1', 'VT_RF', 'right'], ['C313.2', 'FM_MIX_B', 'right']],
notes: [[140, 54, 'V_RF1'], [330, 290, 'tank: L306 with C309 and\nthe varactor, tuned by VT_RF']],
});
SCH_BLOCKS.push({
id: 'fmlo', sheet: 'fmfe', w: 540, h: 362,
parts: [
['Q302', 160, 220],
['R310', 110, 170, 'r90'],
['R311', 110, 260, 'r90'],
['C316', 70, 260, 'r90', 'll'],
['R312', 170, 300, 'r90', 'll'],
['C317', 210, 300, 'r90'],
['C318', 250, 230, 'r90'],
['TP303', 220, 270],
['L307', 170, 110, 'r270 ll'],
['C319', 300, 190, 'r90'],
['C320', 350, 190, 'r90'],
['D302', 350, 250, 'r90'],
['R313', 400, 220, 'r180'],
['C321', 440, 160],
['R309', 420, 60, 'r180'],
['C314', 240, 90, 'r90'],
['C315', 290, 90, 'r90'],
['TP302', 200, 60],
],
wires: [
['C316.1', [70, 220], 'Q302.b'],
['R310.2', [110, 220]], ['R311.1', [110, 220]],
['Q302.e', 'R312.1'],
[[170, 270], [250, 270]], ['C317.1', [210, 270]], ['C318.2', [250, 270]],
['Q302.c', 'L307.1'],
[[170, 160], 'C321.1'],
['C318.1', [250, 160]], ['C319.1', [300, 160]], ['C320.1', [350, 160]],
['C320.2', 'D302.k'], ['R313.2', [350, 220]],
['R310.1', [110, 60], 'R309.2'],
['L307.2', [170, 60]], ['C314.1', [240, 60]], ['C315.1', [290, 60]],
],
gnd: ['C316.2', 'R311.2', 'R312.2', 'C317.2', 'C319.2', 'D302.a', 'C314.2', 'C315.2'],
rails: [['R309.1', '+5V_FM', 'right']],
flags: [['R313.1', 'VT_FM', 'right'], ['C321.2', 'FM_MIX_B', 'right']],
notes: [[120, 54, 'V_LO1'], [20, 352, 'base grounded for RF by C316 (common base)'], [270, 300, 'C318 / C317: feedback divider\nthat keeps it oscillating']],
});
SCH_BLOCKS.push({
id: 'fmmix', sheet: 'fmfe', w: 420, h: 290,
parts: [
['Q303', 200, 170],
['R314', 140, 120, 'r90'],
['R315', 140, 220, 'r90'],
['R316', 210, 230, 'r90', 'll'],
['C322', 250, 230, 'r90'],
['TP304', 270, 110],
['TP305', 350, 240],
],
wires: [
[[80, 170], 'Q303.b'],
['R314.2', [140, 170]], ['R315.1', [140, 170]],
['Q303.e', 'R316.1'], [[210, 200], [250, 200], 'C322.1'],
['Q303.c', [210, 110], [310, 110]],
],
gnd: ['R315.2', 'R316.2', 'C322.2', 'TP305.p'],
rails: [['R314.1', '+5V_FM', 'up']],
flags: [[[80, 170], 'FM_MIX_B', 'left'], [[310, 110], 'IF_MIX', 'right']],
notes: [[20, 195, 'RF in via C313\nLO in via C321'], [228, 140, 'difference product\nat 10.7 MHz'], [300, 76, 'load: R501 330 Ω\n(shared with AM)']],
});
// Sheet 7: FM 455 kHz limiter & pulse-count discriminator (tools/design.py lines 705-778)
SCH_BLOCKS.push({
id: 'lim', sheet: 'fmif', w: 620, h: 320,
parts: [
// V_IF4: +5VA through R701, decoupled by C701 / C702
['R701', 70, 60, 'lb'], ['C701', 120, 90, 'r90'], ['C702', 170, 90, 'r90'], ['TP701', 210, 60],
// input low-pass
['C703', 80, 200], ['R702', 140, 200], ['C704', 180, 220, 'r90'], ['C705', 220, 200],
// stage 1
['R703', 260, 100, 'r90', { label: [9, -9, 'start'] }], ['R704', 260, 250, 'r90'],
['Q701', 300, 200],
['R705', 310, 260, 'r90'], ['C706', 360, 260, 'r90'],
['R706', 310, 100, 'r90', { label: [9, -9, 'start'] }], ['C707', 350, 160, 'r90'], ['TP702', 330, 140],
['C708', 400, 140],
// stage 2
['R707', 440, 100, 'r90', { label: [9, -9, 'start'] }], ['R708', 440, 250, 'r90'],
['Q702', 480, 200],
['R709', 490, 260, 'r90'], ['C709', 540, 260, 'r90'],
['R710', 490, 100, 'r90', { label: [9, -9, 'start'] }], ['C710', 540, 160, 'r90'], ['TP703', 515, 140],
['TP709', 40, 290],
],
wires: [
['R701.2', [490, 60], 'R710.1'],
['C701.1', [120, 60]], ['C702.1', [170, 60]],
['R703.1', [260, 60]], ['R706.1', [310, 60]], ['R707.1', [440, 60]],
['C703.2', 'R702.1'], ['R702.2', 'C705.1'],
['C705.2', 'Q701.b'], ['R703.2', [260, 200]], ['R704.1', [260, 200]],
['Q701.e', 'R705.1'], [[310, 230], [360, 230], 'C706.1'],
['R706.2', 'Q701.c'], [[310, 140], 'C708.1'], [[370, 140], [370, 110]],
['C708.2', [440, 140]], ['R707.2', [440, 200]], ['R708.1', [440, 200]], [[440, 200], 'Q702.b'],
['Q702.e', 'R709.1'], [[490, 230], [540, 230], 'C709.1'],
['R710.2', 'Q702.c'], [[490, 140], [560, 140]],
],
gnd: ['C701.2', 'C702.2', 'C704.2', 'R704.2', 'R705.2', 'C706.2', 'C707.2', 'R708.2', 'R709.2', 'C709.2', 'C710.2', 'TP709.p'],
rails: [['R701.1', '+5VA', 'left']],
flags: [['C703.1', 'IF2_OUT', 'left'], [[370, 110], 'LIM1_C', 'right'], [[560, 140], 'LIM2_C', 'right']],
notes: [[100, 54, 'V_IF4'], [100, 250, 'R702 + C704:\n≈ 480 kHz low-pass'], [370, 305, 'each stage ≈ 33 dB at Ic ≈ 0.95 mA']],
});
SCH_BLOCKS.push({
id: 'rssi', sheet: 'fmif', w: 420, h: 190,
parts: [
['C711', 100, 80], ['R711', 150, 100, 'r90'], ['D701', 200, 80, 'r180'],
['C712', 250, 100, 'r90'], ['R712', 300, 100, 'r90'], ['TP704', 330, 80],
],
wires: [['C711.2', 'D701.a'], ['D701.k', [350, 80]]],
gnd: ['R711.2', 'C712.2', 'R712.2'],
flags: [['C711.1', 'LIM1_C', 'left'], [[350, 80], 'RSSI_FM', 'right']],
notes: [[140, 160, 'peak detector on limiter stage 1;\nR712 × C712 = 10 ms hold']],
});
SCH_BLOCKS.push({
id: 'sq', sheet: 'fmif', w: 430, h: 270,
parts: [
['R713', 110, 150, 'lb'], ['C713', 110, 110],
['R714', 160, 190, 'r90', 'll'],
['Q703', 200, 150],
['R715', 210, 70, 'r90'],
['MC24', 250, 110],
['R716', 290, 130, 'r90'], ['R717', 290, 210, 'r90'], ['TP705', 330, 170],
],
wires: [
['R713.1', 'C713.1'], ['R713.2', 'C713.2'],
['R713.2', 'Q703.b'], ['R714.1', [160, 150]],
['R715.2', 'Q703.c'], [[210, 110], [340, 110]],
['R716.2', 'R717.1'], [[290, 170], [350, 170]],
],
gnd: ['Q703.e', 'R714.2', 'R717.2'],
rails: [['R715.1', 'V_IF4', 'up']],
flags: [['R713.1', 'LIM2_C', 'left'], [[340, 110], 'LIM_SQ', 'right'], [[350, 170], 'IF_CNT', 'right']],
notes: [[40, 240, 'Q703 switches when LIM2_C\ncrosses ≈ 2.2 V'], [330, 205, '≈ 3 V logic level\nfor the MCU timer']],
});
SCH_BLOCKS.push({
id: 'pump', sheet: 'fmif', w: 550, h: 320,
parts: [
['C714', 190, 110],
['D702', 250, 160],
['U701A', 380, 170],
['C715', 380, 70, 'r180'],
['R718', 380, 110, 'r180'],
['MC23', 450, 170],
// VREF_FM: V_IF4 divided by R725 / R726
['R725', 60, 190, 'r90'], ['R726', 60, 270, 'r90'],
['C722', 110, 250, 'r90'], ['C723', 160, 250, 'r90'], ['TP706', 190, 230],
['C721', 460, 260, 'r90'],
['TP710', 510, 290],
],
wires: [
['C714.2', [250, 110], 'D702.m'],
['D702.k', 'U701A.-'],
[[320, 160], [320, 70], 'C715.2'], ['R718.2', [320, 110]],
['C715.1', [430, 70], [430, 170]], ['R718.1', [430, 110]],
['U701A.o', [470, 170]],
['R725.2', 'R726.1'],
[[60, 230], [330, 230], [330, 180], 'U701A.+'],
['D702.a', [210, 230]],
],
gnd: ['R726.2', 'C722.2', 'C723.2', 'C721.2', 'TP710.p'],
rails: [['R725.1', 'V_IF4', 'up'], ['C721.1', '+5VA', 'up']],
flags: [['C714.1', 'LIM_SQ', 'left'], [[470, 170], 'FM_DEMOD', 'right']],
notes: [[225, 224, 'VREF_FM ≈ 3.5 V'], [110, 66, 'each IF cycle pumps a fixed\ncharge into the − input'],
[442, 90, '51k ∥ 1.5n = 76 µs\nde-emphasis'], [360, 300, 'U701: +5VA / GND']],
});
SCH_BLOCKS.push({
id: 'fmaud', sheet: 'fmif', w: 580, h: 300,
parts: [
['C717', 90, 140],
['R721', 130, 160, 'r90', 'll'],
['R722', 170, 140], ['R723', 250, 140],
['C718', 290, 70], ['C719', 290, 160, 'r90', 'll'],
['U701B', 350, 150, 'my'],
['TP708', 370, 70],
['R724', 440, 150], ['C720', 480, 170, 'r90'], ['MC16', 480, 150],
// AFC: FM_DC = 2/3 FM_DEMOD, smoothed
['R719', 110, 230], ['R720', 150, 250, 'r90'], ['C716', 200, 250, 'r90'], ['TP707', 230, 230],
],
wires: [
['C717.2', 'R722.1'], ['R722.2', 'R723.1'], ['R723.2', 'U701B.+'],
['C718.1', [210, 70], [210, 140]], ['C718.2', [410, 70], [410, 150]],
['U701B.-', [320, 190], [390, 190], [390, 150]],
['U701B.o', 'R724.1'], ['R724.2', [500, 150]],
['C717.1', [70, 230], 'R719.1'], ['R719.2', [250, 230]],
],
gnd: ['C719.2', 'C720.2', 'R720.2', 'C716.2'],
flags: [['C717.1', 'FM_DEMOD', 'left'], ['R721.2', 'VREF_1V65', 'right'], [[500, 150], 'FM_AUDIO', 'right'], [[250, 230], 'FM_DC', 'right']],
notes: [[430, 46, 'unity-gain Sallen-Key,\n15.8 kHz: removes the\n19 kHz stereo pilot'], [320, 234, 'FM_DC = 2/3 × FM_DEMOD,\nsmoothed for AFC']],
});
// Sheet 5: 10.7 MHz IF & second conversion to 455 kHz (tools/design.py lines 566-624)
SCH_BLOCKS.push({
id: 'cf1', sheet: 'if', w: 490, h: 270,
parts: [
['R502', 160, 50, 'r90'],
['C503', 210, 90, 'r90'],
['C504', 260, 90, 'r90'],
['TP501', 310, 70],
['R501', 100, 120, 'r90'],
['C502', 130, 190, 'r90'],
['C501', 190, 170],
['FL501', 260, 170, '', { text: '10.7M' }],
['R503', 320, 190, 'r90'],
['TP503', 350, 170],
['C505', 400, 170],
],
wires: [
['R501.1', [100, 70], [420, 70]],
[[60, 170], 'C501.1'], ['R501.2', [100, 170]],
['C501.2', 'FL501.in'],
['FL501.out', 'C505.1'],
],
gnd: ['C503.2', 'C504.2', 'C502.2', 'FL501.g', 'R503.2'],
rails: [['R502.1', '+5VA', 'up']],
flags: [[[60, 170], 'IF_MIX', 'left'], [[420, 70], 'V_IF1', 'right'], ['C505.2', 'IF_B1', 'right']],
notes: [[20, 246, 'C502 shunts VHF LO\nfeed-through'], [190, 246, '330 Ω source (R501) and load (R503):\nthe filter\'s design impedance']],
});
SCH_BLOCKS.push({
id: 'ifamp', sheet: 'if', w: 520, h: 340,
parts: [
['Q501', 160, 180],
['R504', 120, 110, 'r90'],
['R505', 120, 220, 'r90'],
['R508', 170, 90, 'r90'],
['R506', 170, 230, 'r90'],
['R507', 170, 290, 'r90'],
['C506', 220, 290, 'r90'],
['TP504', 200, 130],
['C507', 240, 130],
['FL502', 310, 130, '', { text: '10.7M' }],
['R509', 370, 150, 'r90'],
['MC20', 400, 130],
['C508', 440, 130],
],
wires: [
[[60, 50], [170, 50], 'R508.1'], ['R504.1', [120, 50]],
[[60, 180], 'Q501.b'], ['R504.2', [120, 180]], ['R505.1', [120, 180]],
['R508.2', 'Q501.c'], [[170, 130], 'C507.1'],
['C507.2', 'FL502.in'],
['FL502.out', 'C508.1'],
['Q501.e', 'R506.1'], ['R506.2', 'R507.1'], [[170, 260], [220, 260], 'C506.1'],
],
gnd: ['R505.2', 'R507.2', 'C506.2', 'FL502.g', 'R509.2'],
flags: [[[60, 50], 'V_IF1', 'left'], [[60, 180], 'IF_B1', 'left'], ['C508.2', 'MIX2_B', 'right']],
notes: [[230, 234, 'Ic ≈ 3.9 mA; the unbypassed\n22 Ω sets gain ≈ 15 dB'], [280, 200, 'R508 / R509 330 Ω:\nFL502 source and load']],
});
SCH_BLOCKS.push({
id: 'mix2', sheet: 'if', w: 470, h: 310,
parts: [
['R514', 230, 50, 'r90'],
['C512', 280, 90, 'r90'],
['C513', 330, 90, 'r90'],
['TP502', 370, 70],
['Q502', 160, 200],
['R510', 130, 130, 'r90'],
['R511', 130, 240, 'r90'],
['R513', 170, 110, 'r90'],
['R512', 170, 260, 'r90'],
['C510', 220, 260, 'r90'],
['C511', 250, 170, 'r90'],
['MC21', 290, 150],
],
wires: [
['R510.1', [130, 70], [410, 70]], ['R513.1', [170, 70]],
[[60, 200], 'Q502.b'], ['R510.2', [130, 200]], ['R511.1', [130, 200]],
['R513.2', 'Q502.c'], [[170, 150], [330, 150]],
['Q502.e', 'R512.1'], [[170, 230], [220, 230], 'C510.1'],
],
gnd: ['C512.2', 'C513.2', 'R511.2', 'R512.2', 'C510.2', 'C511.2'],
rails: [['R514.1', '+5VA', 'up']],
flags: [[[60, 200], 'MIX2_B', 'left'], [[330, 150], 'IF2_OUT', 'right'], [[410, 70], 'V_IF2', 'right']],
notes: [[20, 226, 'IF in via C508\nLO in via C509'], [270, 230, '10.695 MHz IF − 10.24 MHz LO\n= 455 kHz at the collector']],
});
SCH_BLOCKS.push({
id: 'xo', sheet: 'if', w: 490, h: 310,
parts: [
['Q503', 210, 170],
['R515', 120, 110, 'r90'],
['R516', 120, 210, 'r90'],
['Y501', 70, 190, 'r90', { label: [-14, -1, 'end'] }],
['C516', 70, 240, 'r90', { label: [-12, -1, 'end'] }],
['C514', 170, 200, 'r90'],
['R517', 270, 240, 'r90'],
['C515', 320, 240, 'r90'],
['TP505', 360, 220],
['C509', 410, 220],
['TP506', 450, 270],
],
wires: [
[[70, 60], [220, 60], 'Q503.c'], ['R515.1', [120, 60]],
['Y501.1', 'Q503.b'], ['R515.2', [120, 170]], ['R516.1', [120, 170]], [[170, 170], 'C514.1'],
['Y501.2', 'C516.1'],
['C514.2', 'C509.1'], ['Q503.e', [220, 220]],
],
gnd: ['R516.2', 'C516.2', 'R517.2', 'C515.2', 'TP506.p'],
flags: [[[70, 60], 'V_IF2', 'left'], ['C509.2', 'MIX2_B', 'right']],
notes: [[240, 120, 'collector at RF ground;\nLO taken at the emitter'], [30, 296, 'crystal load: C516, C515, C514 in series ≈ 12 pF']],
});
// Sheet 1: power, USB & MCU (tools/design.py lines 296-371)
(function () {
// ---------------------------------------------------------------- usb: USB-C / machine-pin input & ESD
const J101 = { w: 60, h: 210, title: ['J101', 'USB-C'], pins: [
['VBUS', 'R', 20, ['A4', 'A9', 'B4', 'B9']],
['D+', 'R', 100, ['A6', 'B6']],
['D-', 'R', 120, ['A7', 'B7']],
['CC1', 'R', 160, ['A5']],
['CC2', 'R', 180, ['B5']],
['GND', 'B', 30, ['A1', 'A12', 'B1', 'B12', 'SH']],
] };
// USBLC6 is flow-through: I/O1 = pins 1 and 6, I/O2 = pins 3 and 4. The right-hand names end in a
// space only to keep the pin keys unique (SVG drops the space when drawing).
const U101 = { w: 110, h: 60, title: ['U101', 'USBLC6-2SC6'], pins: [
['VBUS', 'T', 15, ['5']],
['I/O1', 'L', 20, ['1']], ['I/O2', 'L', 40, ['3']],
['I/O1 ', 'R', 20, ['6']], ['I/O2 ', 'R', 40, ['4']],
['GND', 'B', 55, ['2']],
] };
SCH_BLOCKS.push({
id: 'usb', sheet: 'power', w: 600, h: 340,
parts: [
['J101', 60, 205, '', { box: J101 }],
['MC1', 40, 60, 'r270'],
['TP102', 100, 60],
['TP101', 130, 120],
['D106', 240, 60, 'r180'],
['D105', 240, 120, 'r180'],
['TP103', 300, 120],
['F101', 350, 120],
['C101', 400, 140, 'r90'],
['C102', 445, 140, 'r90'],
['R107', 490, 140, 'r90'],
['D104', 490, 180, 'r270'],
['TP104', 525, 120],
['U101', 215, 210, '', { box: U101 }],
['MC3', 300, 200],
['MC4', 300, 220, 'r180'],
['R102', 120, 300, 'r90'],
['R101', 170, 300, 'r90'],
],
wires: [
['MC1.p', 'D106.a'],
['J101.VBUS', 'D105.a'],
['U101.VBUS', [175, 120]],
['D106.k', [280, 60], [280, 120]],
['D105.k', 'F101.1'],
['F101.2', [550, 120]],
['J101.D+', 'U101.I/O1'], ['J101.D-', 'U101.I/O2'],
['U101.I/O1 ', [340, 200]], ['U101.I/O2 ', [340, 220]],
['J101.CC1', [170, 260], 'R101.1'],
['J101.CC2', 'R102.1'],
],
gnd: ['J101.GND', 'U101.GND', 'R101.2', 'R102.2', 'C101.2', 'C102.2', 'D104.k'],
rails: [[[550, 120], '+5V', 'right']],
flags: [[[340, 200], 'USB_DP', 'right'], [[340, 220], 'USB_DM', 'right']],
notes: [[295, 52, 'B5819W OR-ing:\nUSB-C or VIN contact'], [215, 296, 'CC pull-downs mark\nthe board as a sink']],
});
// ---------------------------------------------------------------- reg: 3.3 V LDO & filtered analog rails
const U102 = { w: 70, h: 50, title: ['U102', 'AP2112K-3.3'], pins: [
['VIN', 'L', 10, ['1']], ['EN', 'L', 30, ['3']], ['VOUT', 'R', 10, ['5']], ['GND', 'B', 35, ['2']],
] };
SCH_BLOCKS.push({
id: 'reg', sheet: 'power', w: 590, h: 280,
parts: [
['C103', 60, 100, 'r90'],
['U102', 170, 95, '', { box: U102 }],
['TP105', 235, 80],
['C104', 265, 100, 'r90'],
['C105', 310, 100, 'r90'],
['FB102', 370, 80],
['C108', 420, 100, 'r90'],
['C109', 465, 100, 'r90'],
['TP106', 505, 80],
['FB101', 90, 200],
['C106', 140, 220, 'r90'],
['C107', 185, 220, 'r90'],
['TP107', 225, 200],
['TP108', 440, 250],
['TP109', 480, 250],
],
wires: [
[[30, 80], 'U102.VIN'],
['U102.EN', [105, 100], [105, 80]],
[[30, 80], [30, 200], 'FB101.1'],
['U102.VOUT', 'FB102.1'],
['FB102.2', [530, 80]],
['FB101.2', [250, 200]],
],
gnd: ['C103.2', 'U102.GND', 'C104.2', 'C105.2', 'C108.2', 'C109.2', 'C106.2', 'C107.2', 'TP108.p', 'TP109.p'],
rails: [[[30, 80], '+5V', 'up'], ['C104.1', '+3V3', 'up'], [[530, 80], '+3.3VA', 'right'], [[250, 200], '+5VA', 'right']],
notes: [[300, 197, '+5VA feeds every RF / IF\nstage and the op-amps'], [400, 150, '+3.3VA: MCU VREF+\n(ADC / DAC reference)']],
});
// ---------------------------------------------------------------- mcu: STM32G0B1
// Right side: [pin name, offset, QFN pin, net]; every one leaves the block through a flag.
const RIGHT = [
['PA0 ADC_IN0', 20, '11', 'AM_AUDIO'], ['PA1 ADC_IN1', 40, '12', 'FM_AUDIO'],
['PA2 ADC_IN2', 60, '13', 'RSSI_AM'], ['PA3 ADC_IN3', 80, '14', 'FM_DC'], ['PA6 ADC_IN6', 100, '17', 'RSSI_FM'],
['PA4 DAC1_OUT1', 130, '15', 'DAC_FM'], ['PA5 DAC1_OUT2', 150, '16', 'DAC_AM'],
['PA8 TIM1_CH1', 200, '28', 'CAL_MARK'], ['PB1 TIM3_CH4', 220, '20', 'PWM_RF'], ['PA15 TIM2_ETR', 240, '37', 'IF_CNT'],
['PB8 open-drain', 270, '47', 'FM_EN_N'], ['PB9 open-drain', 290, '48', 'AM_EN_N'],
['PB13 GPIO', 320, '25', 'LED_FM'], ['PB14 GPIO', 340, '26', 'LED_AM'], ['PB15 GPIO', 360, '27', 'LED_STAT'],
];
const TOP = 110, FX = 440; // box top edge, x of the right-hand flags
const U103 = { w: 190, h: 380, title: ['U103', 'STM32G0B1CCU7'], pins: [
['VBAT', 'T', 15, ['4']], ['VREF+', 'T', 45, ['5']], ['VDD/VDDA', 'T', 160, ['6']],
['PA12 USB_DP', 'L', 20, ['34']], ['PA11 USB_DM', 'L', 40, ['33']],
['PB6 USART1_TX', 'L', 80, ['45']], ['PB7 USART1_RX', 'L', 100, ['46']],
['PA13 SWDIO', 'L', 140, ['35']], ['PA14 SWCLK/BOOT0', 'L', 160, ['36']],
['NRST', 'L', 250, ['10']],
['PF0 OSC_IN', 'B', 30, ['8']], ['PF1 OSC_OUT', 'B', 110, ['9']], ['VSS/EP', 'B', 160, ['7', '49']],
].concat(RIGHT.map((r) => [r[0], 'R', r[1], [r[2]]])) };
SCH_BLOCKS.push({
id: 'mcu', sheet: 'power', w: 570, h: 590,
parts: [
['U103', 295, TOP + 190, '', { box: U103 }],
// supplies
['C110', 170, 80, 'r90'],
['C111', 420, 80, 'r90'],
['C114', 465, 80, 'r90'],
['MC6', 500, 60],
// debug / console contacts and their parts
['MC12', 60, 190, 'r270'],
['MC13', 60, 210, 'r270'],
['MC10', 60, 250, 'r270'],
['MC7', 60, 270, 'r270'],
['R103', 130, 290, 'r90'],
['MC8', 60, 360, 'r270'],
['C115', 130, 380, 'r90'],
// crystal
['Y101', 270, 520],
['C116', 230, 540, 'r90'],
['C117', 310, 540, 'r90'],
['TP110', 420, TOP + 200],
],
wires: [
['U103.VREF+', [245, 60], [130, 60]],
['U103.VBAT', [215, 60]],
['U103.VDD/VDDA', [360, 60], [520, 60]],
['U103.PA12 USB_DP', [120, 130]], ['U103.PA11 USB_DM', [120, 150]],
['U103.PB6 USART1_TX', 'MC12.p'], ['U103.PB7 USART1_RX', 'MC13.p'],
['U103.PA13 SWDIO', 'MC10.p'], ['U103.PA14 SWCLK/BOOT0', 'MC7.p'],
['U103.NRST', 'MC8.p'],
['U103.PF0 OSC_IN', 'C116.1'], ['C116.1', 'Y101.1'],
['U103.PF1 OSC_OUT', 'C117.1'], ['C117.1', 'Y101.2'],
].concat(RIGHT.map((r) => ['U103.' + r[0], [FX, TOP + r[1]]])),
gnd: ['C110.2', 'C111.2', 'C114.2', 'R103.2', 'C115.2', 'C116.2', 'C117.2', 'U103.VSS/EP'],
rails: [[[130, 60], '+3.3VA', 'up'], [[520, 60], '+3V3', 'right']],
flags: [[[120, 130], 'USB_DP', 'left'], [[120, 150], 'USB_DM', 'left']]
.concat(RIGHT.map((r) => [[FX, TOP + r[1]], r[3], 'right'])),
notes: [[20, 300, 'BOOT0 is on PA14:\nR103 holds it low'], [360, 535, '40 MHz: timers and, since\nfirmware v0.3, USB too']],
});
})();
// Sheet 2: tuning, band switching & user interface (tools/design.py lines 374-439)
SCH_BLOCKS.push({
id: 'vt', sheet: 'tune', w: 480, h: 380,
parts: [
// FM: DAC1 -> x1.45 -> two RC poles -> VT_FM
['TP201', 80, 100],
['U201A', 140, 110, 'my'],
['R201', 140, 160, 'r180'],
['R202', 110, 180, 'r90', 'll'],
['TP204', 200, 110],
['R203', 240, 110], ['C201', 280, 130, 'r90'],
['R204', 320, 110], ['C202', 360, 130, 'r90'],
['MC25', 380, 110],
// AM: DAC2 -> x1.45 -> two RC poles -> VT_AM
['TP202', 80, 250],
['U201B', 140, 260, 'my'],
['R205', 140, 310, 'r180'],
['R206', 110, 330, 'r90', 'll'],
['TP205', 200, 260],
['R207', 240, 260], ['C203', 280, 280, 'r90'],
['R208', 320, 260], ['C204', 360, 280, 'r90'],
['MC26', 380, 260],
// supply decoupling
['C205', 440, 50, 'r90'],
],
wires: [
[[60, 100], 'U201A.+'],
['U201A.-', 'R202.1'], ['R201.2', 'R202.1'],
['U201A.o', 'R203.1'], ['R201.1', [180, 160], [180, 110]],
['R203.2', 'R204.1'], ['R204.2', [400, 110]],
[[60, 250], 'U201B.+'],
['U201B.-', 'R206.1'], ['R205.2', 'R206.1'],
['U201B.o', 'R207.1'], ['R205.1', [180, 310], [180, 260]],
['R207.2', 'R208.1'], ['R208.2', [400, 260]],
],
gnd: ['R202.2', 'C201.2', 'C202.2', 'R206.2', 'C203.2', 'C204.2', 'C205.2'],
rails: [['C205.1', '+5VA', 'up']],
flags: [[[60, 100], 'DAC_FM', 'left'], [[400, 110], 'VT_FM', 'right'],
[[60, 250], 'DAC_AM', 'left'], [[400, 260], 'VT_AM', 'right']],
notes: [[130, 190, 'gain 1 + 10k/22k = 1.45'], [262, 340, 'two RC poles per channel: a quiet\nvaractor voltage keeps the LO clean'],
[425, 54, 'U201: +5VA / GND', 'end']],
});
SCH_BLOCKS.push({
id: 'pwm', sheet: 'tune', w: 560, h: 340,
parts: [
// PB1 PWM -> 2-pole RC -> x1.45 -> VT_RF
['TP203', 80, 80],
['R209', 120, 80], ['C206', 160, 100, 'r90'],
['R210', 200, 80], ['C207', 240, 100, 'r90'],
['U202A', 320, 90, 'my'],
['R211', 320, 140, 'r180'],
['R212', 290, 160, 'r90', 'll'],
['TP206', 380, 90],
['R213', 420, 90], ['C208', 460, 110, 'r90'],
['MC27', 480, 90],
// VDDA / 2 -> unity buffer -> VREF_1V65
['R214', 100, 230, 'r90'], ['R215', 100, 270, 'r90', 'll'], ['C209', 140, 270, 'r90'],
['U202B', 230, 260, 'my'],
['R216', 310, 260], ['C210', 350, 280, 'r90'],
['TP207', 370, 260],
// supply decoupling
['C211', 500, 250, 'r90'],
],
wires: [
[[60, 80], 'R209.1'],
['R209.2', 'R210.1'], ['R210.2', 'U202A.+'],
['U202A.-', 'R212.1'], ['R211.2', 'R212.1'],
['U202A.o', 'R213.1'], ['R211.1', [360, 140], [360, 90]],
['R213.2', [500, 90]],
['R214.2', 'U202B.+'],
['U202B.o', 'R216.1'], ['U202B.-', [200, 290], [270, 290], [270, 260]],
['R216.2', [390, 260]],
],
gnd: ['C206.2', 'C207.2', 'R212.2', 'C208.2', 'R215.2', 'C209.2', 'C210.2', 'C211.2'],
rails: [['R214.1', '+3.3VA', 'up'], ['C211.1', '+5VA', 'up']],
flags: [[[60, 80], 'PWM_RF', 'left'], [[500, 90], 'VT_RF', 'right'], [[390, 260], 'VREF_1V65', 'right']],
notes: [[100, 150, '2-pole RC low-pass, 16 Hz'], [310, 180, 'gain 1 + 10k/22k = 1.45'], [500, 300, 'U202: +5VA / GND', 'middle']],
});
SCH_BLOCKS.push({
id: 'band', sheet: 'tune', w: 400, h: 390,
parts: [
// FM front-end supply switch
['R217', 140, 80, 'r90'],
['MC28', 170, 60],
['R218', 100, 120, 'r180'],
['Q201', 190, 120, 'my'],
['C212', 240, 180, 'r90'], ['C213', 290, 180, 'r90'],
['TP208', 320, 160],
// AM front-end supply switch
['R219', 140, 250, 'r90'],
['R220', 100, 290, 'r180'],
['Q202', 190, 290, 'my'],
['C214', 240, 350, 'r90'], ['C215', 290, 350, 'r90'],
['TP209', 320, 330],
],
wires: [
['R217.1', [200, 60], 'Q201.e'],
['R218.1', 'Q201.b'], ['R217.2', [140, 120]],
['Q201.c', [200, 160], [340, 160]],
['R219.1', [200, 230], 'Q202.e'],
['R220.1', 'Q202.b'], ['R219.2', [140, 290]],
['Q202.c', [200, 330], [340, 330]],
],
gnd: ['C212.2', 'C213.2', 'C214.2', 'C215.2'],
rails: [['R217.1', '+5VA', 'up'], ['R219.1', '+5VA', 'up'], [[340, 160], '+5V_FM', 'right'], [[340, 330], '+5V_AM', 'right']],
flags: [['R218.2', 'FM_EN_N', 'left'], ['R220.2', 'AM_EN_N', 'left']],
notes: [[25, 142, 'low = band on\nhigh-Z = off'], [210, 82, 'R217 pulls the base to\n5 V: off at reset']],
});
SCH_BLOCKS.push({
id: 'ui', sheet: 'tune', w: 360, h: 300,
parts: [
['R224', 120, 50], ['D201', 160, 70, 'r270'],
['R225', 120, 130], ['D202', 160, 150, 'r270'],
['R226', 120, 210], ['D203', 160, 230, 'r270'],
['TP210', 290, 150], ['TP211', 330, 150],
],
wires: [
['R224.2', 'D201.a'], ['R225.2', 'D202.a'], ['R226.2', 'D203.a'],
['TP210.p', 'TP211.p'],
],
gnd: ['D201.k', 'D202.k', 'D203.k', [310, 150]],
flags: [['R224.1', 'LED_FM', 'left'], ['R225.1', 'LED_AM', 'left'], ['R226.1', 'LED_STAT', 'left']],
notes: [[40, 274, 'GPIO high = LED on. Green and blue drop\n~2.8 V, so their resistors are only 220 Ω']],
});
/* spectrum.js: a stage-by-stage spectrum model of the AM/FM receiver, and its SVG renderer.
*
* Example signals at the antenna are followed through every stage: linear stages add their gain
* curve (dB) at each signal's frequency, mixers move every signal to |f - LO| (and f + LO), the limiter
* and squarer clip, the detectors turn the IF into audio. Responses come from the component values
* (L/C ladders, Sallen-Key, de-emphasis) or the datasheets (ceramic filters); the RF-amp and mixer gains
* are estimates and are labelled as such. Frequencies are MHz throughout.
*/
var SPECTRUM = (function () {
'use strict';
const IF1 = 10.695, LO2 = 10.240, IF2 = 0.455;
const lg = (x) => Math.log10(Math.max(x, 1e-30));
const psum = (...v) => 10 * lg(v.reduce((s, x) => s + Math.pow(10, x / 10), 0));
// ---------------------------------------------------------------- responses
const cx = (re, im) => ({ re, im: im || 0 });
const add = (a, b) => cx(a.re + b.re, a.im + b.im);
const mul = (a, b) => cx(a.re * b.re - a.im * b.im, a.re * b.im + a.im * b.re);
const div = (a, b) => { const d = b.re * b.re + b.im * b.im; return cx((a.re * b.re + a.im * b.im) / d, (a.im * b.re - a.re * b.im) / d); };
// |S21| in dB of an L/C ladder between Rs and Rl. elems: [series|shunt, 'L'|'C', value, inductor Q]
function ladder(elems, f, Rs, Rl) {
const w = 2 * Math.PI * Math.max(f, 1e-4) * 1e6;
let A = cx(1), B = cx(0), C = cx(0), D = cx(1);
for (const [kind, type, val, q] of elems) {
let Z = type === 'L' ? cx(q ? w * val / q : 0, w * val) : cx(0, -1 / (w * val));
const m = kind === 's' ? [cx(1), Z, cx(0), cx(1)] : [cx(1), cx(0), div(cx(1), Z), cx(1)];
[A, B, C, D] = [add(mul(A, m[0]), mul(B, m[2])), add(mul(A, m[1]), mul(B, m[3])), add(mul(C, m[0]), mul(D, m[2])), add(mul(C, m[1]), mul(D, m[3]))];
}
const den = add(add(mul(A, cx(Rl)), B), add(mul(C, cx(Rs * Rl)), mul(D, cx(Rs))));
return 20 * lg(2 * Math.sqrt(Rs * Rl) / Math.hypot(den.re, den.im));
}
const FM_LEG = [['s', 'C', 47e-12], ['p', 'L', 56e-9, 35], ['s', 'C', 47e-12], ['p', 'C', 22e-12], ['s', 'L', 120e-9, 35], ['p', 'C', 22e-12]];
const AM_LEG = [['s', 'L', 2.2e-6, 30], ['p', 'C', 2.7e-9], ['s', 'L', 8.2e-6, 30], ['p', 'C', 2.7e-9], ['s', 'L', 2.2e-6, 30]];
const fmLeg = (f) => Math.max(-150, ladder(FM_LEG, f, 50, 54));
const amLeg = (f) => Math.max(-150, ladder(AM_LEG, f, 50, 48));
// single tuned circuit
const tank = (f, f0, Q) => -10 * lg(1 + Q * Q * Math.pow(f / f0 - f0 / f, 2));
// ceramic filters, shaped to the datasheet points (HCCF3 10.7: 180 kHz at -3 dB, 470 kHz at -20 dB, 35 dB floor, 4 dB loss;
// HCCF2 455: +/-4.5 kHz at -6 dB, +/-10 kHz at -45 dB, 6 dB loss)
const cer10 = (f) => -4 - Math.min(35, 10 * lg(1 + Math.pow(Math.abs(f - 10.7) * 1000 / 90, 4.8)));
const cer455 = (f) => -6 - Math.min(45, 10 * lg(1 + Math.pow(Math.abs(f - 0.455) * 1000 / 4.09, 11.6)));
const rc1 = (f, fc) => -10 * lg(1 + Math.pow(f / fc, 2)); // first-order low-pass
const sallenKey = (f, f0, Q) => { const x = f / f0; return -10 * lg(Math.pow(1 - x * x, 2) + Math.pow(x / Q, 2)); };
const deemph = (f) => rc1(f, 1 / (2 * Math.PI * 51e3 * 1.5e-9) / 1e6); // 76.5 us
const fir = (f) => { const k = f * 1000; return k <= 15 ? 0 : k >= 30 ? -60 : -60 * Math.pow((k - 15) / 15, 1.6); };
const notch19 = (f) => -52 * Math.exp(-Math.pow((f * 1000 - 19) / 0.35, 2));
// ---------------------------------------------------------------- the antenna scene (example signals)
function plan(band, mode, fFm, fAm) {
if (band === 'fm') {
const f0 = fFm;
if (mode === 'design') return { f0, lo: f0 + IF1, side: 'above', ok: f0 + IF1 >= 98.7 - 1e-9 && f0 + IF1 <= 118.7 + 1e-9 };
if (f0 + IF1 <= 99.2) return { f0, lo: f0 + IF1, side: 'above', ok: f0 + IF1 >= 91.5 };
if (f0 - IF1 >= 91.5 && f0 - IF1 <= 99.2) return { f0, lo: f0 - IF1, side: 'below', ok: true };
return { f0, lo: null, side: 'none', ok: false };
}
const f0 = fAm / 1000;
if (mode === 'design') return { f0, lo: f0 + IF1, side: 'above', ok: f0 + IF1 >= 11.23 - 1e-9 && f0 + IF1 <= 12.4 + 1e-9 };
const lo = IF1 - f0;
return { f0, lo, side: 'sum', ok: lo >= 9.547 && lo <= 10.162 };
}
// ---------------------------------------------------------------- what the STM32 sets: tuning DAC, RF-tracking PWM, marker, DSP
const VREF = 3.3, GVT = 1.45;
const dacV = (code) => Math.max(0, Math.min(4095, code)) / 4095 * VREF; // PA4 / PA5, 12-bit
const pwmV = (code) => GVT * Math.max(0, Math.min(4096, code)) / 4096 * VREF; // PB1 averaged, then x1.45
// BB910 varactor fitted to its datasheet: about 39 pF at 0.5 V and 13.5 pF at 5 V
const Cv = (v) => 56e-12 * Math.pow(1 + Math.max(0, v) / 0.7, -0.678);
const ser = (a, b) => a * b / (a + b);
const fRes = (L, C) => 1 / (2 * Math.PI * Math.sqrt(L * C)) / 1e6;
// as designed: the varactor curve's shape, spanning the design's stated LO ranges over 0-4.8 V
function designVco(band, vt) {
const shape = band === 'fm' ? (v) => fRes(110e-9, 7.84e-12 + ser(22e-12, Cv(v)))
: (v) => fRes(8.2e-6, 1 / (1 / (15e-12 + ser(33e-12, Cv(v))) + 1 / 220e-12 + 1 / 470e-12));
const [f0, f1] = band === 'fm' ? [98.7, 118.7] : [11.23, 12.4];
const a = shape(0), b = shape(4.8);
return f0 + (f1 - f0) * (shape(Math.min(4.8, vt)) - a) / (b - a);
}
// first board: the measured calibration tables (firmware/README.md), DAC code -> LO in MHz; the ends are extrapolated
const BOARD_FM = [[0, 91.46], [107, 91.5604], [919, 92.3153], [1152, 92.7418], [1302, 92.9999], [2237, 94.7116], [3347, 97.1143], [3674, 97.985], [3927, 98.7136], [4095, 99.2]];
const BOARD_AM = [[0, 9.5474], [147, 9.6066], [360, 9.6955], [628, 9.7885], [887, 9.8673], [1169, 9.9442], [1495, 10.0282], [1776, 10.0952], [2063, 10.1622], [4095, 10.2]];
const interp = (tab, x) => {
for (let i = 1; i < tab.length; i++) if (x <= tab[i][0]) { const [x0, y0] = tab[i - 1], [x1, y1] = tab[i]; return y0 + (y1 - y0) * (x - x0) / (x1 - x0); }
return tab[tab.length - 1][1];
};
const vco = (band, mode, code) => (mode === 'board' ? interp(band === 'fm' ? BOARD_FM : BOARD_AM, Math.max(0, Math.min(4095, code))) : designVco(band, GVT * dacV(code)));
function invert(fn, target, lo, hi) { // fn rising on [lo, hi]
if (target < fn(lo) - 1e-9 || target > fn(hi) + 1e-9) return null;
for (let i = 0; i < 44; i++) { const m = (lo + hi) / 2; if (fn(m) < target) lo = m; else hi = m; }
return Math.round((lo + hi) / 2);
}
// RF tank (a model): L306 150 nH with C309 and ~1.7 pF of strays (5 pF), and the varactor through C310 22 pF
const tankF = (vt) => fRes(150e-9, 5e-12 + ser(22e-12, Cv(vt)));
const CTL0 = { tune: 'station', dac: 2000, pwmMode: 'track', pwm: 2400, marker: false, markerN: 13, notch: true, nf: 'auto', gain: 0, mute: false, hum: true };
// the effective settings: which LO the DAC gives, where the station lands, where the RF tank sits
function control(S) {
const c = Object.assign({}, CTL0, S.ctl || {});
const P0 = plan(S.band, S.mode, S.f.fm, S.f.am);
let lo = P0.lo, side = P0.side, dac;
if (c.tune === 'dac') {
dac = c.dac;
lo = vco(S.band, S.mode, dac);
side = S.band === 'fm' ? (lo >= P0.f0 ? 'above' : 'below') : S.mode === 'board' ? 'sum' : 'above';
} else {
dac = lo == null ? null : invert((x) => vco(S.band, S.mode, x), lo, 0, 4095);
}
const if1 = lo == null ? null : side === 'sum' ? lo + P0.f0 : Math.abs(lo - P0.f0);
const if2 = if1 == null ? null : Math.abs(if1 - LO2);
let pwm = c.pwm;
if (c.pwmMode === 'track') {
if (S.mode === 'board') pwm = 2400; // the first board's firmware parks it here
else { const p = invert((x) => tankF(pwmV(x)), P0.f0, 0, 4096); pwm = p == null ? (P0.f0 < tankF(0) ? 0 : 4096) : p; }
}
return { c, P: Object.assign({}, P0, { lo, side, ok: c.tune === 'dac' ? lo != null : P0.ok }), dac, vt: dac == null ? null : GVT * dacV(dac), vdac: dac == null ? null : dacV(dac),
if1, if2, pwm, vtRf: pwmV(pwm), tank: tankF(pwmV(pwm)), tankRange: [tankF(0), tankF(4.8)], markerF: 48 / c.markerN };
}
function scene(S, K) {
const P = K.P;
const fmBand = S.band === 'fm', sig = [];
const push = (id, label, kind, f, db, bw) => { if (f > 0) sig.push({ id, label, kind, f, db, bw }); };
// FM broadcast band, placed around the FM station
const ffm = S.f.fm;
const wrap = (f) => (f > 107.9 ? f - 20.2 : f < 87.7 ? f + 20.2 : f);
push('fm0', fmBand ? 'Your station' : 'FM station', fmBand ? 'station' : 'other', ffm, -65, 0.2);
const sideSign = fmBand && P.side === 'below' ? -1 : 1;
const fmOthers = [['fmU', 0.4, -58, 'Station 400 kHz up'], ['fmD', -0.4, -72, 'Station 400 kHz down'],
['fm2i', 0.91 * sideSign, -60, sideSign > 0 ? 'Station 910 kHz up' : 'Station 910 kHz down'],
['fmL', -3.1, -48, 'Strong local station'], ['fmA', 5.3, -66, 'FM station'], ['fmB', -7.7, -60, 'FM station'], ['fmC', 9.9, -70, 'FM station']];
for (const [id, off, db, label] of fmOthers) push(id, label, 'other', wrap(ffm + off), db, 0.2);
// medium wave, placed around the AM station
const fam = S.f.am / 1000;
push('am0', fmBand ? 'AM station' : 'Your station', fmBand ? 'other' : 'station', fam, -55, 0.01);
const amNb = [['amU', 0.01, -63, 'Station 10 kHz up'], ['amD', -0.01, -67, 'Station 10 kHz down'], ['amU2', 0.02, -61, 'Station 20 kHz up']];
for (const [id, off, db, label] of amNb) if (fam + off >= 0.53 && fam + off <= 1.71) push(id, label, 'other', fam + off, db, 0.01);
const amFixed = [0.62, 0.82, 0.97, 1.08, 1.31, 1.5];
amFixed.forEach((f, i) => { if (Math.abs(f - fam) > 0.025) push('amF' + i, 'AM station', 'other', f, [-52, -48, -56, -58, -62, -57][i], 0.01); });
// the calibration marker: TIM1 on PA8 puts a 48 MHz / N square wave on the antenna through R317 and C323
if (K.c.marker) for (let k = 1; k * K.markerF <= 300; k++) push('mk' + k, 'Calibration marker, harmonic ' + k + ' (' + k + ' \u00d7 48/' + K.c.markerN + ' MHz)', 'mark', k * K.markerF, -40 - 10 * lg(k), 0.002);
return { P, sig };
}
// man-made and atmospheric noise rises below 30 MHz; -125 dBm is the display floor (10 kHz bandwidth)
const antNoise = (f) => -125 + 30 * Math.max(0, lg(30 / Math.max(f, 0.3)));
// ---------------------------------------------------------------- stage helpers
const shift = (s, H) => (s.lev ? Object.assign({}, s, { lev: ((L0) => (f) => L0(f) + H(f))(s.lev), db: s.db + H(s.f) }) : Object.assign({}, s, { db: s.db + H(s.f) }));
const offset = (s, d) => shift(s, () => d);
const linear = (prev, H, self) => ({
sig: prev.sig.map((s) => shift(s, H)),
nf: (f) => psum(prev.nf(f) + H(f), self == null ? -300 : self + H(f)),
});
function mixer(prev, lo, sumOnly, G, self) {
const out = [];
for (const s of prev.sig) {
const d = Math.abs(s.f - lo), u = s.f + lo;
if (!sumOnly) out.push(Object.assign({}, s, { f: d, db: s.db + G, from: s.f, db0: s.db, sum: false }));
out.push(Object.assign({}, s, { id: s.id + ':sum', f: u, db: s.db + G, from: s.f, db0: s.db, sum: true, kind: sumOnly ? s.kind : 'other', label: sumOnly ? s.label : s.label + ' (sum product)' }));
}
return {
sig: out,
nf: (f) => psum(prev.nf(Math.abs(lo - f) || 1e-6) + G, prev.nf(lo + f) + G, f > lo ? prev.nf(f - lo) + G : -300, self),
};
}
// the mixer's whole output for the wide view: both copies of your station keep its colour
const products = (sig, stId) => sig.map((s) => (s.id.split(':')[0] === stId ? Object.assign({}, s, { kind: 'station' }) : s));
const within = (sig, ax) => sig.filter((s) => s.f + (s.bw || 0) >= ax.min && s.f - (s.bw || 0) <= ax.max);
const fmtF = (f, unit) => (unit === 'kHz' ? +(f * 1000).toFixed(f * 1000 < 10 ? 2 : 1) + ' kHz' : +f.toFixed(f < 1 ? 4 : 3) + ' MHz');
// programme audio: most energy below 1 kHz, falling above; broadcasters pre-emphasise above 2.1 kHz
const prog = (f) => -10 * lg(1 + Math.pow(f / 0.001, 2));
const preemph = (f) => -deemph(f);
const dB = (x) => (x >= 0 ? '+' : '−') + Math.abs(x).toFixed(Math.abs(x) < 10 ? 1 : 0) + ' dB';
const mag = (x) => Math.abs(x).toFixed(Math.abs(x) < 10 ? 1 : 0) + ' dB';
// ---------------------------------------------------------------- the chain
// the firmware's DSP, part by part, as the STM32 controls set it
function dspParts(K, fm) {
const c = K.c, parts = [{ name: 'FIR \u00f74', title: '32-tap FIR: flat to 15 kHz, 58 dB down by 30 kHz, then every 4th sample (48 kHz)', kind: 'filter', H: fir }];
if (fm && c.notch) parts.push({ name: '19 kHz notch', title: 'The pilot notch: \u221252 dB at 19 kHz', kind: 'filter', H: notch19 });
if (c.nf === 'strong') parts.push({ name: 'Noise filter', title: 'Noise filter, strong: a low-pass from 10 kHz', kind: 'filter', H: (f) => sallenKey(f, 0.010, 0.707) });
if (c.hum) parts.push({ name: 'Hum canceller', title: 'The 1 kHz template canceller: \u221239 \u2192 \u221260 dBFS', kind: 'filter', H: (f) => (Math.abs(f * 1000 - 1) < 0.15 || Math.abs(f * 1000 - 3) < 0.15 ? -21 : 0) });
if (c.gain) parts.push({ name: 'Gain', title: 'Gain ' + dB(c.gain) + ' (and the soft limiter above \u22124 dBFS)', kind: 'gain', H: () => c.gain });
if (c.mute) parts.push({ name: 'Mute', title: 'Muted: nothing goes to the PC', kind: 'convert', to: { sig: [], nf: () => -200 } });
return parts;
}
const humTones = () => [{ id: 'hum1', label: '1 kHz tone from the DSP\u2019s own 1 ms activity (through VREF+)', kind: 'other', f: 0.001, bw: 0, db: -39 },
{ id: 'hum3', label: '3 kHz harmonic of that tone', kind: 'other', f: 0.003, bw: 0, db: -50 }];
function runParts(start, parts) {
let cur = start;
for (const p of parts) cur = p.kind === 'convert' ? p.to : linear(cur, p.H, -300);
return cur;
}
// animation steps: one per part of a stage. Each step has what it applies (H) and the spectrum before and after.
function mkSteps(start, parts, end) {
const steps = start ? [{ name: 'In', kind: 'in', title: 'The signal coming in', to: start }] : [];
let cur = start || { sig: [], nf: () => -300 };
parts.forEach((p, i) => {
let nxt = p.kind === 'convert' ? p.to : linear(cur, p.H, -300);
if (i === parts.length - 1 && end) nxt = end;
steps.push(Object.assign({}, p, { from: cur, to: nxt }));
cur = nxt;
});
return steps;
}
function build(S) {
const K = control(S);
const { P, sig } = scene(S, K);
const fm = S.band === 'fm';
const st = (x) => x.sig.find((s) => s.kind === 'station' && !s.sum);
const img = (x) => x.sig.find((s) => s.kind === 'image' && !s.sum);
const stages = [];
const LOGAX = { min: 0.1, max: 3000, log: true, unit: 'MHz', ticks: [0.1, 0.3, 1, 3, 10, 30, 100, 300, 1000, 3000] };
let cur = { sig, nf: antNoise };
stages.push({ id: 'ant-in', block: 'ant', title: 'Antenna', parts: 'J301 SMA', ax: LOGAX, y: [-160, -10], yUnit: 'dBm', out: cur,
strip: 'Example stations at the antenna (not a measurement): the medium-wave (AM) band and the FM band. The noise rises toward low frequencies, as man-made and atmospheric noise do.',
cap: 'Everything arrives at once. The station you want is at ' + fmtF(P.f0, fm ? 'MHz' : 'kHz') + '.' });
// diplexer
const legH = fm ? fmLeg : amLeg;
const prevAnt = cur;
cur = linear(cur, legH, -300);
const legAtSt = legH(P.f0);
const legEl = fm ? FM_LEG : AM_LEG, legRl = fm ? 54 : 48;
const cum = (k) => (f) => (k ? Math.max(-150, ladder(legEl.slice(0, k), f, 50, legRl)) : 0);
const legParts = fm ? [['High-pass', 'C303, L304 and C304: a 70 MHz high-pass', 3], ['Low-pass', 'C305, L305 and C306: a 130 MHz low-pass', 6]]
: [['L301, C301', 'L301 (series) and C301 (shunt): the first two poles', 2], ['L302, C302', 'L302 and C302: two more poles', 4], ['L303', 'L303: the fifth pole', 5]];
const legSteps = mkSteps(prevAnt, legParts.map(([name, title, k], i) => ({ name, title, kind: 'filter', H: ((a, b) => (f) => cum(b)(f) - cum(a)(f))(i ? legParts[i - 1][2] : 0, k) })), cur);
const otherBand = fm ? 1.0 : 100;
stages.push({ id: 'ant-leg', block: 'ant', title: fm ? 'Diplexer, FM leg' : 'Diplexer, AM leg', parts: fm ? 'C303 L304 C304 / C305 L305 C306' : 'L301 C301 L302 C302 L303',
ax: LOGAX, y: [-160, -10], yUnit: 'dBm', out: cur, ghost: prevAnt, resp: { H: legH, y: [-120, 10] }, steps: legSteps,
cap: fm ? 'The 70 MHz high-pass and 130 MHz low-pass, computed from the six L/C values. The station loses ' + mag(legAtSt) + '; medium wave at 1 MHz drops ' + mag(legH(otherBand)) + ', so it is gone, and above 130 MHz the low-pass pulls the noise down too (' + mag(legH(1000)) + ' at 1 GHz).'
: 'The 5-pole 2 MHz low-pass, computed from its L/C values. The station loses ' + mag(legAtSt) + '; FM at 100 MHz drops ' + mag(legH(otherBand)) + '.' });
// RF amplifier
if (fm) {
const G = 16, Q = 10;
const H = (f) => G + tank(f, K.tank, Q);
const ax = { min: 60, max: 140, unit: 'MHz', ticks: [60, 70, 80, 90, 100, 110, 120, 130, 140] };
const pin = cur;
cur = linear(cur, H, -113 - G);
const ii = img(cur);
const tk = 'tuned to ' + fmtF(K.tank) + ' by VT_RF = ' + K.vtRf.toFixed(2) + ' V (PWM ' + K.pwm + ')';
stages.push({ id: 'fmrf', block: 'fmrf', title: 'RF amplifier & tracking tank', parts: 'Q301, L306, D301', ax, y: [-120, -20], yUnit: 'dBm', out: cur, ghost: pin, est: true,
resp: { H, y: [-30, 25] }, refs: [[K.tank, 'tank']],
steps: mkSteps(pin, [{ name: 'Tank', title: 'L306, C309 and the varactor: a peak ' + tk, kind: 'filter', H: (f) => tank(f, K.tank, Q) }, { name: 'Q301 gain', title: '+' + G + ' dB from Q301', kind: 'gain', H: () => G }], cur),
cap: 'About ' + G + ' dB of gain at the tank\u2019s peak, falling away either side: a loaded Q of about ' + Q + ' (both estimated from the component values). The tank is ' + tk + '; your station gets ' + dB(H(P.f0)) + '.' + (S.mode === 'board' ? ' On the first board the firmware parks it at PWM 2400.' : '') });
} else {
const G = 24, H = () => G;
const ax = { min: 0, max: 2.5, unit: 'MHz', ticks: [0, 0.5, 1, 1.5, 2, 2.5] };
const pin = cur;
cur = linear(cur, H, -113);
stages.push({ id: 'amrf', block: 'amrf', title: 'AM preamplifier', parts: 'Q401', ax, y: [-120, 0], yUnit: 'dBm', out: cur, ghost: pin,
steps: mkSteps(pin, [{ name: 'Q401 gain', title: '+' + G + ' dB from Q401', kind: 'gain', H: () => G }], cur),
resp: { H, y: [0, 40] }, cap: 'A flat ' + G + ' dB across medium wave (the design note’s figure). Nothing here is tuned.' });
}
// first mixer
const IFAX = fm ? { min: 9.2, max: 12.2, unit: 'MHz', ticks: [9.5, 10, 10.5, 11, 11.5, 12] }
: { min: 9.2, max: 12.2, unit: 'MHz', ticks: [9.5, 10, 10.5, 11, 11.5, 12] };
const broken = P.lo == null || (S.mode === 'board' && !P.ok);
if (!broken) {
const sumOnly = P.side === 'sum';
const G = 10;
const pin = cur;
cur = mixer(cur, P.lo, false, G, -110);
if (sumOnly) cur.sig = cur.sig.map((s) => (s.sum ? Object.assign({}, s, { kind: pin.sig.find((x) => x.id === s.id.replace(':sum', '')).kind, label: s.label.replace(' (sum product)', '') }) : Object.assign({}, s, { kind: s.kind === 'image' ? 'image' : 'other', label: s.label + (s.kind === 'station' ? ' (difference product)' : '') })));
if (sumOnly) cur.sig.forEach((s) => { if (s.kind === 'station' && !s.sum) s.kind = 'other'; });
const how = P.side === 'sum' ? 'LO + f' : P.side === 'below' ? 'f − LO' : 'LO − f';
const stOut = cur.sig.filter((s) => s.kind === 'station').sort((a, b) => Math.abs(a.f - IF1) - Math.abs(b.f - IF1))[0];
const lands = stOut && Math.abs(stOut.f - IF1) < 0.002;
const offTxt = stOut ? 'Your station comes out at ' + fmtF(stOut.f) + ', ' + Math.round(Math.abs(stOut.f - IF1) * 1000) + ' kHz from the 10.695 MHz centre (the AFC is off), so the filters will cut it.' : 'Your station does not land near the IF.';
const il = cur.sig.find((s) => s.kind === 'image' && Math.abs(s.f - IF1) < 0.02);
const stIn = pin.sig.find((x) => x.kind === 'station');
const keep = sumOnly ? 'sum' : 'diff';
const dTxt = P.side === 'below' ? 'f \u2212 LO' : 'LO \u2212 f', sTxt = 'LO + f';
const q = fm ? 'Q303' : 'Q403';
stages.push({ id: fm ? 'fmmix' : 'ammix', block: fm ? 'fmmix' : 'ammix', title: fm ? 'FM mixer' : 'AM mixer', parts: fm ? 'Q303, LO from Q302' : 'Q403, LO from Q402',
ax: IFAX, y: [-120, -10], yUnit: 'dBm', out: { sig: within(cur.sig, IFAX), nf: cur.nf }, est: true,
refs: [[IF1, '10.695 MHz IF']],
inAx: fm ? { min: 0, max: 240, unit: 'MHz', ticks: [0, 40, 80, 120, 160, 200, 240] } : { min: 0, max: 16, unit: 'MHz', ticks: [0, 2, 4, 6, 8, 10, 12, 14, 16] },
inp: { sig: pin.sig, nf: pin.nf }, lo: P.lo, map: how,
prod: { sig: products(cur.sig, stIn && stIn.id), nf: cur.nf },
notes: { diff: dTxt + (keep === 'diff' ? ': kept' : ': filtered out'), sum: sTxt + (keep === 'sum' ? ': kept' : ': filtered out') },
steps: [{ name: 'In', kind: 'in', title: 'going in: ' + (fm ? 'the FM band' : 'medium wave') + ', and the LO at ' + fmtF(P.lo) },
{ name: '\u00d7 LO', kind: 'mix', title: q + ' \u00d7 LO: two copies, one down by the LO, one up' },
{ name: 'Zoom', kind: 'out', title: 'the box at 10.7 MHz, magnified below' }],
strip: 'Multiplying by the LO makes two copies of everything: one at ' + dTxt + ', one at ' + sTxt + ', with LO = ' + fmtF(P.lo) + (P.side === 'below' ? ' (below the station, as on the first board)' : P.side === 'sum' ? ' (the first board\u2019s low AM LO, so the sum is the one kept)' : '') + '. Conversion gain about +' + G + ' dB (estimate).',
cap: (lands ? 'Your station lands on 10.695 MHz.' : offTxt) + (fm ? ' The station 910 kHz up lands on 9.785 MHz, which the second mixer would also fold onto 455 kHz, so the 10.7 MHz filters must remove it.' : '') + (P.side === 'above' ? ' The difference copy is mirrored: a copy pushed past 0 Hz folds back (cos(\u2212x) = cos x), so the stations come out in reverse order.' : '') });
} else {
stages.push({ id: fm ? 'fmmix' : 'ammix', block: fm ? 'fmmix' : 'ammix', title: fm ? 'FM mixer' : 'AM mixer', parts: '', ax: IFAX, y: [-120, -10], yUnit: 'dBm', out: { sig: [], nf: () => -110 },
fault: fm ? 'Out of reach: the LO covers 91.5 to 99.2 MHz, so no LO setting puts this station on the IF.' : 'Out of reach: the AM LO covers 9.55 to 10.16 MHz, which reaches about 533 to 1150 kHz.', strip: 'Every signal moves by the LO frequency.', cap: '' });
}
if (!broken) {
// first 10.7 MHz filter
const AX2 = fm ? IFAX : { min: 10.395, max: 10.995, unit: 'MHz', ticks: [10.45, 10.55, 10.65, 10.75, 10.85, 10.95] };
let pin = cur;
cur = linear(cur, cer10, -300);
const near = (x, df) => x.sig.find((s) => s.kind === 'other' && !s.sum && Math.abs(s.f - (IF1 + df)) < 0.003);
stages.push({ id: 'cf1', block: 'cf1', title: 'First 10.7 MHz filter', parts: 'FL501, R501 / R503', ax: AX2, y: [-120, -10], yUnit: 'dBm', out: { sig: within(cur.sig, AX2), nf: cur.nf },
ghost: { sig: within(pin.sig, AX2) }, resp: { H: cer10, y: [-45, 5] },
steps: mkSteps(pin, [{ name: 'FL501', title: 'FL501: the 10.7 MHz ceramic filter', kind: 'filter', H: cer10 }], cur),
cap: 'The datasheet shape: 180 kHz wide at −3 dB, at most 470 kHz at −20 dB, 4 dB loss. ' + (fm ? 'FM’s ±75 kHz deviation fits; the neighbours 400 kHz away drop by about ' + mag(cer10(IF1 + 0.4) + 4) + '.' : 'For AM it is far too wide: stations within about ±90 kHz still pass. The 455 kHz filter does the AM channel selection later.') });
// IF amplifier + second filter
pin = cur;
const H2 = (f) => 15 + cer10(f);
cur = linear(cur, H2, -110 - 15);
stages.push({ id: 'ifamp', block: 'ifamp', title: 'IF amplifier & second filter', parts: 'Q501, FL502', ax: AX2, y: [-120, -10], yUnit: 'dBm', out: { sig: within(cur.sig, AX2), nf: cur.nf },
ghost: { sig: within(pin.sig, AX2) }, resp: { H: H2, y: [-30, 20] },
steps: mkSteps(pin, [{ name: 'Q501 gain', title: '+15 dB from Q501', kind: 'gain', H: () => 15 }, { name: 'FL502', title: 'FL502: the same filter again', kind: 'filter', H: cer10 }], cur),
cap: '+15 dB from Q501 (design note), then the same filter again. Two in cascade double the skirt: ' + (fm ? 'the station now at 9.785 MHz has lost ' + mag(2 * cer10(9.785)) + ' since the mixer.' : 'neighbours 100 kHz away are now ' + mag(2 * (cer10(IF1 + 0.1) + 4)) + ' down.') });
// second mixer
pin = cur;
const G2 = 10;
const mx = mixer(cur, LO2, false, G2, -105);
const full = mx.sig.map((s) => Object.assign({}, s, { db: s.db + rc1(s.f, 1.06) }));
mx.sig = full.filter((s) => !s.sum);
const nf2 = mx.nf;
const st2 = pin.sig.find((x) => x.kind === 'station');
cur = { sig: mx.sig, nf: (f) => nf2(f) + rc1(f, 1.06) };
const AX3 = fm ? { min: 0, max: 1.2, unit: 'kHz', ticks: [0, 0.2, 0.4, 0.6, 0.8, 1.0, 1.2] } : { min: 0.155, max: 0.755, unit: 'kHz', ticks: [0.2, 0.3, 0.4, 0.5, 0.6, 0.7] };
const i2 = cur.sig.find((s) => s.id === 'fm2i');
stages.push({ id: 'mix2', block: 'mix2', title: 'Second mixer', parts: 'Q502, crystal LO Q503 / Y501', ax: AX3, y: [-120, -10], yUnit: 'dBm', out: { sig: within(cur.sig, AX3), nf: cur.nf }, est: true,
refs: [[IF2, '455 kHz']],
inp: { sig: pin.sig, nf: pin.nf }, lo: LO2, map: '|f \u2212 10.240 MHz|', noBands: true,
inAx: { min: 0, max: 24, unit: 'MHz', ticks: [0, 4, 8, 12, 16, 20, 24] },
prod: { sig: products(full, st2 && st2.id), nf: (f) => nf2(f) + rc1(f, 1.06) },
notes: { diff: '|f \u2212 10.24|: kept', sum: 'f + 10.24: rolled off by C511' },
steps: [{ name: 'In', kind: 'in', title: 'going in: the 10.7 MHz IF, and the crystal at 10.240 MHz' },
{ name: '\u00d7 10.24 MHz', kind: 'mix', title: 'Q502 \u00d7 crystal: two copies, one down by 10.24 MHz, one up' },
{ name: 'Zoom', kind: 'out', title: 'the box below 1.2 MHz, magnified below' }],
strip: 'Multiplying by the 10.240 MHz crystal makes two copies again: 10.695 − 10.240 = 0.455 MHz is kept, 10.695 + 10.240 = 20.935 MHz is rolled off. Conversion gain about +' + G2 + ' dB (estimate); C511 rolls off above 1 MHz.',
cap: (fm && i2 ? 'The station 910 kHz away folds onto 455 kHz as well, but the two 10.7 MHz filters have already put it ' + mag(i2.db - (st(cur) ? st(cur).db : 0)) + ' below your station.' : 'Your station and its neighbours keep their spacing; only the centre frequency changes.') });
if (fm) {
// limiter (with its 480 kHz RC input filter)
const rc = (f) => rc1(f, 0.482);
const inp = cur.sig.map((s) => Object.assign({}, s, { db: s.db + rc(s.f) }));
const inband = inp.filter((s) => Math.abs(s.f - IF2) < 0.12).sort((a, b) => b.db - a.db);
const floorIn = cur.nf(IF2) + rc(IF2) + 10 * lg(180 / 10);
const dom = inband[0] && inband[0].db > floorIn + 6 ? inband[0] : null;
const AX4 = { min: 0, max: 2.5, unit: 'kHz', ticks: [0, 0.5, 1, 1.5, 2, 2.5] };
const LOUT = 5;
const out = [];
const cRoll = (f) => rc1(f, 1.54);
if (dom) {
[1, 3, 5].forEach((k) => out.push(Object.assign({}, dom, { id: dom.id + (k > 1 ? ':h' + k : ''), f: dom.f * k, bw: dom.bw, harm: k > 1, db: LOUT - 20 * lg(k) + cRoll(dom.f * k) - cRoll(dom.f),
label: k > 1 ? (k === 3 ? '3rd' : '5th') + ' harmonic from the clipping' : dom.label })));
for (const s of inp) if (s !== dom && s.f > 0.05 && s.f < 1.0) { const v = LOUT + (s.db - dom.db) - 6; if (v > -80) out.push(Object.assign({}, s, { db: v })); }
} else {
out.push({ id: 'noise', label: 'Limited noise (no carrier)', kind: 'other', f: IF2, bw: 0.18, db: 0 });
}
const capt = dom && dom.kind !== 'station';
const nfPre = cur.nf;
const limIn = cur;
// for the waveform view: levels at the limiter input, before its RC (dBV rms)
const limTd = { carrier: !!dom, capt, fIF: dom ? dom.f : IF2, pre: dom ? dom.db - rc(dom.f) - 13 : null, noise: floorIn - rc(IF2) - 13 };
cur = { sig: out, nf: (f) => Math.max(-80, dom ? nfPre(f) + rc(f) - dom.db + LOUT - 6 : -40) };
stages.push({ id: 'lim', block: 'lim', title: 'Limiter', parts: 'R702 / C704, Q701, Q702', ax: AX4, y: [-80, 15], yUnit: 'dBV', out: cur, td: limTd,
steps: mkSteps({ sig: limIn.sig.map((x) => offset(x, -13)), nf: (f) => limIn.nf(f) - 13 }, [{ name: 'RC 482 kHz', title: 'R702 and C704: a 482 kHz low-pass strips the last 10 MHz products', kind: 'filter', H: rc }, { name: 'Clip', title: 'Q701 and Q702: 66 dB of gain, then clipping. Constant amplitude, odd harmonics.', kind: 'convert', to: cur }], cur),
strip: 'About 66 dB of gain, then hard clipping: the output sits at about +5 dBV whatever the input level. Amplitude is thrown away; only the frequency is kept.',
cap: dom ? (capt ? 'The ' + dom.label.toLowerCase() + ' is stronger than your station, so it captures the limiter.' : 'Your station captures the limiter: weaker signals in the passband come out further down than they went in (the capture effect), and the clipping adds odd harmonics at 1.365 and 2.275 MHz.') + ' RSSI_FM taps stage 1, which already clips on noise alone, so it cannot rank stations.' : 'No carrier: the limiter clips the noise to full level, which is the hiss between stations.' });
// squarer
const AX5 = { min: 0, max: 3.5, unit: 'kHz', ticks: [0, 0.5, 1, 1.5, 2, 2.5, 3, 3.5] };
const sq = [];
if (dom) [1, 3, 5, 7].forEach((k) => sq.push(Object.assign({}, dom, { id: dom.id + (k > 1 ? ':h' + k : ''), f: dom.f * k, bw: dom.bw, harm: k > 1, db: 6.3 - 20 * lg(k), label: k > 1 ? 'Harmonic ' + k : dom.label })));
else sq.push({ id: 'noise', label: 'Random edges from noise', kind: 'other', f: IF2, bw: 0.25, db: 0 });
const sqIn = cur;
cur = { sig: sq, nf: () => -80 };
stages.push({ id: 'sq', block: 'sq', title: 'Squarer', parts: 'Q703 → LIM_SQ, IF_CNT', ax: AX5, y: [-80, 15], yUnit: 'dBV', out: cur, td: limTd,
steps: mkSteps(sqIn, [{ name: 'Switch', title: 'Q703 switches at 2.2 V: a clean 0 to 4.6 V square wave', kind: 'convert', to: cur }], cur),
strip: 'Q703 switches at 2.2 V: a clean 0 to 4.6 V square wave (+6.3 dBV fundamental) with odd harmonics falling as 1/n. A divided copy, IF_CNT, goes to the MCU’s counter.',
cap: 'The MCU counts these edges for AFC, seek and calibration. The detector only cares when the edges arrive.' });
// pulse-count detector + de-emphasis: now in audio
const AXA = { min: 0, max: 0.06, unit: 'kHz', ticks: [0, 0.01, 0.02, 0.03, 0.04, 0.05, 0.06] };
const k = 0.34 / 75 / Math.SQRT2; // volts rms per kHz of deviation
const v = (devKHz) => 20 * lg(devKHz * k);
const band = (id, label, kind, f1, f2, lev) => ({ id, label, kind, f: (f1 + f2) / 2, bw: f2 - f1, band: [f1, f2], lev, db: lev((f1 + f2) / 2) });
const Lp = v(50) - 4;
const mpx = dom ? [
band(dom.id, (capt ? dom.label + ', now audio' : 'Your station’s audio') + ' (L+R)', dom.kind === 'station' ? 'station' : dom.kind, 0.00005, 0.015, (f) => Lp + prog(f) + preemph(f)),
{ id: 'pilot', label: '19 kHz stereo pilot', kind: 'sub', f: 0.019, bw: 0, db: v(7.5) },
band('lmr', 'Stereo difference signal (L−R), 23 to 53 kHz', 'sub', 0.023, 0.053, (f) => Lp - 6 + prog(Math.abs(f - 0.038)) + preemph(Math.abs(f - 0.038))),
band('rds', 'RDS data, 57 kHz', 'sub', 0.0546, 0.0594, (f) => v(2) - 3 * Math.pow((f - 0.057) / 0.0024, 2)),
] : [];
const N0 = dom ? -95 : -45;
const triNoise = (f) => N0 + 20 * lg(Math.max(f, 0.0003) / 0.001);
const ghostA = { sig: mpx, nf: triNoise };
cur = { sig: mpx.map((s) => shift(s, deemph)), nf: (f) => triNoise(f) + deemph(f) };
stages.push({ id: 'pump', block: 'pump', title: 'Pulse-count detector & de-emphasis', parts: 'C714, D702, U701A', ax: AXA, y: [-110, 0], yUnit: 'dBV', out: cur, ghost: ghostA, td: { carrier: !!dom, N0 },
steps: mkSteps(null, [{ name: 'f \u2192 V', title: 'The charge pump turns frequency into voltage: the broadcast\u2019s multiplex appears', kind: 'convert', to: ghostA }, { name: 'De-emphasis', title: 'R718 \u2225 C715: the 76.5 \u00b5s de-emphasis', kind: 'filter', H: deemph }], cur),
resp: { H: deemph, y: [-40, 5] },
cap: dom ? 'The charge pump turns frequency into voltage: out comes the broadcast’s whole multiplex (grey). R718 ∥ C715 is a 76.5 µs de-emphasis: it rolls off above 2.1 kHz, undoing the transmitter’s treble boost and flattening the noise, which leaves an FM detector rising with frequency.' : 'With no carrier the detector puts out loud noise that rises with frequency: the hiss.' });
// audio filter
const sk = (f) => sallenKey(f, 0.01576, 0.743);
const pa = cur;
cur = linear(cur, sk, -300);
stages.push({ id: 'fmaud', block: 'fmaud', title: 'FM audio filter', parts: 'U701B Sallen-Key', ax: AXA, y: [-110, 0], yUnit: 'dBV', out: cur, ghost: pa, resp: { H: sk, y: [-40, 5] }, td: { carrier: !!dom, N0, pre: [deemph] },
steps: mkSteps(pa, [{ name: 'Sallen-Key', title: 'U701B: a 15.8 kHz two-pole low-pass', kind: 'filter', H: sk }], cur),
refs: [[0.024, 'half of 48 kHz']],
cap: 'A 15.8 kHz two-pole low-pass (Q 0.74). The pilot drops only ' + mag(sk(0.019)) + ' and the stereo signal about ' + mag(sk(0.038)) + ': sampled at 48 kHz, everything right of the 24 kHz line would fold back into the audio. That was the first board’s “glitchy” sound.' });
// ADC + DSP
const AXD = { min: 0, max: 0.024, unit: 'kHz', ticks: [0, 0.004, 0.008, 0.012, 0.016, 0.02, 0.024] };
const toFs = -1.3;
const nfA = cur.nf;
const pd = { sig: cur.sig.map((s) => offset(s, toFs)).filter((s) => (s.band ? s.band[0] : s.f) <= 0.024).map((s) => (s.band ? Object.assign({}, s, { band: [s.band[0], Math.min(s.band[1], 0.024)] }) : s)).concat(humTones()), nf: (f) => nfA(f) + toFs };
const parts = dspParts(K, true);
const dsp = runParts(pd, parts);
const Hd = (f) => parts.reduce((a, p) => a + (p.H ? p.H(f) : 0), 0);
cur = dsp;
stages.push({ id: 'dsp', block: 'mcu', title: 'ADC & DSP, then USB', parts: 'STM32G0B1 firmware', ax: AXD, y: [-110, 0], yUnit: 'dBFS', out: { sig: cur.sig, nf: cur.nf }, ghost: pd, resp: { H: Hd, y: [-70, 15] }, td: { band: 'fm', carrier: !!dom, N0, pre: [deemph, sk], toFs },
steps: mkSteps(pd, parts, cur),
cap: 'Sampled at 192 kHz, a 32-tap FIR keeps 0 to 15 kHz and is 58 dB down by 30 kHz, so nothing folds when it decimates to 48 kHz.' + (K.c.notch ? ' A notch takes the pilot down 52 dB.' : ' The pilot notch is off, so the 19 kHz pilot reaches the PC.') + (K.c.hum ? ' The hum canceller removes the 1 kHz tone the DSP itself makes.' : ' The hum canceller is off: the 1 kHz tone from the DSP\u2019s own activity is in the audio at \u221239 dBFS.') + (K.c.mute ? ' Muted.' : ' What reaches the PC over USB is mono audio.') });
} else {
// AM: 455 kHz filter
const AX5 = { min: 0.43, max: 0.48, unit: 'kHz', ticks: [0.43, 0.44, 0.45, 0.46, 0.47, 0.48] };
const pin = cur;
cur = linear(cur, cer455, -300);
const nb = cur.sig.filter((s) => s.kind === 'other' && Math.abs(s.f - IF2) < 0.025);
const amLater = S.mode === 'board' ? 'Nothing arrives here on the first board (see stage 8). Grey shows what the design expects.' : null;
const amFault = S.mode === 'board' ? 'Nothing gets past this point. RSSI_AM stays at its 2.39 V rail even with a −40 dBm marker centred on 455 kHz; the fault is somewhere in FL601 → Q601/Q603 → Q605 → D601.' : null;
stages.push({ id: 'amf', block: 'amf', title: '455 kHz AM filter', parts: 'FL601', ax: AX5, y: [-120, -10], yUnit: 'dBm', out: { sig: within(cur.sig, AX5), nf: cur.nf }, ghost: { sig: within(pin.sig, AX5) },
resp: { H: cer455, y: [-55, 5] }, fault: amFault,
steps: mkSteps({ sig: within(pin.sig, AX5), nf: pin.nf }, [{ name: 'FL601', title: 'FL601: \u00b14.5 kHz around 455 kHz', kind: 'filter', H: cer455 }], { sig: within(cur.sig, AX5), nf: cur.nf }),
cap: 'The AM channel selection: ±4.5 kHz at −6 dB and 45 dB down by ±10 kHz (datasheet shape). ' + (nb.length ? 'Stations 10 kHz away lose ' + mag(cer455(IF2 + 0.01) + 6) + ' more than yours.' : '') });
// AGC amplifiers
const stIn = st(cur);
const target = -30;
const Gagc = stIn ? Math.max(-28, Math.min(51, target - (stIn.db - 13))) : 51;
const pv = cur;
cur = { sig: cur.sig.map((s) => offset(s, -13 + Gagc)), nf: (f) => pv.nf(f) - 13 + Gagc };
const deadV = amFault ? { sig: [], nf: (f) => -100 } : null;
stages.push({ id: 'vga', block: 'vga', title: 'AGC amplifiers', parts: 'Q601/Q602, Q603/Q604', ax: AX5, y: [-110, 0], yUnit: 'dBV', out: deadV || { sig: within(cur.sig, AX5), nf: cur.nf }, ghost: deadV ? { sig: within(cur.sig, AX5) } : null, fault: amLater,
resp: { H: () => Gagc, y: [-30, 60] },
steps: deadV ? null : mkSteps({ sig: within(pv.sig, AX5).map((x) => offset(x, -13)), nf: (f) => pv.nf(f) - 13 }, [{ name: 'AGC gain', title: 'The AGC sets the two pairs to ' + dB(Gagc), kind: 'gain', H: () => Gagc }], { sig: within(cur.sig, AX5), nf: cur.nf }),
cap: 'Two differential pairs, each worth −14 to +26 dB depending on the tail current. The AGC loop sets them to ' + dB(Gagc) + ' here, so the carrier leaves at about −30 dBV however strong the station is.' });
// post-amp + envelope detector: audio
const AXA = { min: 0, max: 0.02, unit: 'kHz', ticks: [0, 0.004, 0.008, 0.012, 0.016, 0.02] };
const detH = (f) => rc1(f, 1 / (2 * Math.PI * 22e-6) / 1e6);
const audio = [];
if (stIn) {
audio.push({ id: stIn.id + ':dc', dc: true, label: 'Carrier, now DC (AGC holds it at 1 V)', kind: 'station', f: 0.0001, bw: 0, db: 0 });
audio.push({ id: stIn.id, label: 'Your station’s audio (30 % modulation)', kind: 'station', f: 0.005, bw: 0.0099, band: [0.00005, 0.01], lev: (f) => -14 + prog(f), db: -14 + prog(0.005) });
for (const s of nb) {
const off = Math.abs(s.f - stIn.f);
if (off > 0.003) audio.push({ id: s.id, label: 'Whistle: ' + s.label.toLowerCase() + '’s carrier beating with yours', kind: 'other', f: off, bw: 0, db: s.db - stIn.db - 3 });
}
}
const detRaw = { sig: audio, nf: () => -95 };
// for the waveform view: the carrier, the neighbours' whistles (Hz offset, dB below the carrier), the fault
const amTd = { carrier: !!stIn, fault: !!amFault, wh: stIn ? nb.filter((s) => Math.abs(s.f - stIn.f) > 0.003).map((s) => ({ f: Math.abs(s.f - stIn.f) * 1e6, rel: s.db - stIn.db - 3 })) : [] };
cur = { sig: audio.map((s) => shift(s, detH)), nf: (f) => -95 + detH(f) };
stages.push({ id: 'det', block: 'det', title: 'Post-amp & envelope detector', parts: 'Q605, D601, C612 / R619', ax: AXA, y: [-110, 10], yUnit: 'dBV', out: amFault ? { sig: [], nf: () => -95 } : cur, ghost: amFault ? cur : null, resp: { H: detH, y: [-20, 5] }, fault: amLater, td: amTd,
steps: amFault ? null : mkSteps(null, [{ name: 'Detect', title: 'D601 follows the envelope: the carrier becomes DC, the sidebands become audio', kind: 'convert', to: detRaw }, { name: 'RC 22 \u00b5s', title: 'C612 and R619: the detector\u2019s 22 \u00b5s time constant', kind: 'filter', H: detH }], cur),
cap: 'The diode follows the peaks of the IF: the carrier becomes a DC level (which feeds the AGC) and the sidebands become the audio. Neighbours 10 kHz away become 10 kHz whistles. C612 / R619 (22 µs) start to roll off above 7.2 kHz.' });
// AGC loop + 5 kHz filter
const sk = (f) => sallenKey(f, 0.00495, 0.731);
const pa = cur;
cur = linear({ sig: cur.sig.filter((s) => !s.dc), nf: cur.nf }, sk, -300);
stages.push({ id: 'agc', block: 'agc', title: 'AGC loop & 5 kHz audio filter', parts: 'U601A / U601B', ax: AXA, y: [-110, 10], yUnit: 'dBV', out: amFault ? { sig: [], nf: () => -95 } : cur, ghost: amFault ? cur : pa, resp: { H: sk, y: [-40, 5] }, fault: amLater, td: Object.assign({ pre: [detH] }, amTd),
steps: amFault ? null : mkSteps(pa, [{ name: 'DC block', title: 'C616 blocks the DC, which goes to the AGC integrator instead', kind: 'convert', to: { sig: pa.sig.filter((x) => !x.dc), nf: pa.nf } }, { name: 'Sallen-Key', title: 'U601B: a 4.95 kHz two-pole low-pass', kind: 'filter', H: sk }], cur),
cap: 'C616 blocks the DC (it goes to the AGC integrator instead), and a 4.95 kHz Sallen-Key low-pass trims the audio. The 10 kHz whistles drop another ' + mag(sk(0.01)) + '.' });
// ADC + DSP
const AXD = { min: 0, max: 0.024, unit: 'kHz', ticks: [0, 0.004, 0.008, 0.012, 0.016, 0.02, 0.024] };
const nfB = cur.nf;
const pd = { sig: cur.sig.map((s) => offset(s, -1.3)).concat(humTones()), nf: (f) => nfB(f) - 1.3 };
const parts = dspParts(K, false);
const dsp = runParts(pd, parts);
const Hd = (f) => parts.reduce((a, p) => a + (p.H ? p.H(f) : 0), 0);
stages.push({ id: 'dsp', block: 'mcu', title: 'ADC & DSP, then USB', parts: 'STM32G0B1 firmware', ax: AXD, y: [-110, 0], yUnit: 'dBFS', out: amFault ? { sig: [1, 2, 3].map((k) => ({ id: 'pick' + k, label: k + ' kHz pickup from the firmware\u2019s 1 ms activity (level not measured)', kind: 'other', f: k / 1000, bw: 0, db: -55 })), nf: () => -60 } : dsp, ghost: amFault ? dsp : pd, resp: { H: Hd, y: [-70, 15] }, td: Object.assign({ band: 'am', pre: [detH, sk], toFs: -1.3 }, amTd),
steps: amFault ? null : mkSteps(pd, parts, dsp),
fault: S.mode === 'board' ? 'Only noise (about \u221238 dBFS) and 1, 2 and 3 kHz pickup from the firmware\u2019s 1 ms activity reach the PC.' : null,
cap: 'Sampled at 192 kHz and decimated to 48 kHz through the same 32-tap FIR, then the noise filter, the hum canceller and the gain.' + (K.c.mute ? ' Muted.' : ' What reaches the PC is the AM audio.') });
}
}
return { P, stages, K };
}
// ---------------------------------------------------------------- rendering
const esc = (s) => String(s).replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"');
// The small overview card or the big chart under a schematic, drawn at its real pixel width.
// A mixer gets two spectra: before (IP, on its own axis) and after (SP), with connectors in between (MZ).
function layout(opt, mix) {
const big = !!(opt && opt.big);
if (!big) {
if (mix) return { W: 600, H: 316, L: 46, R: 590, IP: [26, 104], MZ: [124, 160], SP: [186, 284], tickDy: 15, step: 2, big: false };
return { W: 600, H: 236, L: 46, R: 590, RP: [22, 74], SP: [100, 206], tickDy: 15, step: 2, big: false };
}
const W = Math.max(440, Math.round(opt.width || 760));
if (mix) {
const H = Math.round(Math.min(780, Math.max(600, W * 0.86)));
const h = Math.round((H - 36 - 36 - 30 - 66 - 36) * 0.46);
const IP = [36, 36 + h], MZ = [IP[1] + 30, IP[1] + 96];
return { W, H, L: 64, R: W - 20, IP, MZ, SP: [MZ[1] + 36, H - 36], tickDy: 19, step: 1.5, big: true };
}
const H = Math.round(Math.min(560, Math.max(430, W * 0.62)));
const rpTop = 34, rpH = Math.round((H - 110) * 0.27);
return { W, H, L: 64, R: W - 20, RP: [rpTop, rpTop + rpH], SP: [rpTop + rpH + 54, H - 36], tickDy: 19, step: 1.5, big: true };
}
function niceStep(span, n) {
const raw = span / n, p = Math.pow(10, Math.floor(lg(raw)));
for (const m of [1, 2, 2.5, 5]) if (m * p >= raw) return m * p;
return 10 * p;
}
// the axis for a zoom window opt.win = [min, max] (or the stage's own range), with ticks to suit the width
function axisFor(stage, opt) {
const base = stage.ax;
if (!opt || (!opt.win && !opt.big)) return base;
const [min, max] = opt.win || [base.min, base.max];
const ax = { min, max, log: base.log, unit: base.unit, ticks: [] };
const n = Math.max(4, Math.round(((opt.big ? opt.width || 760 : 600) - 90) / 105));
if (base.log) {
const span = lg(max) - lg(min);
const mults = span > 2.2 ? [1, 3] : span > 1.1 ? [1, 2, 5] : span > 0.5 ? [1, 1.5, 2, 3, 5, 7] : null;
if (mults) {
for (let e = Math.floor(lg(min)) - 1; e <= Math.ceil(lg(max)); e++) for (const m of mults) { const t = +(m * Math.pow(10, e)).toPrecision(6); if (t >= min * 0.9999 && t <= max * 1.0001) ax.ticks.push(t); }
} else {
const st = niceStep(max - min, n);
for (let t = Math.ceil(min / st) * st; t <= max * 1.0001; t += st) ax.ticks.push(+t.toPrecision(10));
}
} else {
const st = niceStep(max - min, n);
for (let t = Math.ceil(min / st - 1e-9) * st; t <= max + st * 1e-6; t += st) ax.ticks.push(+t.toPrecision(10));
}
return ax;
}
function scales(ax, lay) {
const { L, R } = lay;
if (ax.log) {
const a = lg(ax.min), b = lg(ax.max);
return { X: (f) => L + (lg(f) - a) / (b - a) * (R - L), F: (x) => Math.pow(10, a + (x - L) / (R - L) * (b - a)) };
}
return { X: (f) => L + (f - ax.min) / (ax.max - ax.min) * (R - L), F: (x) => ax.min + (x - L) / (R - L) * (ax.max - ax.min) };
}
const tickLabel = (t, ax) => (ax.unit === 'MHz' && t >= 1000 ? +(t / 1000).toFixed(3) + ' GHz' : String(+(ax.unit === 'kHz' ? t * 1000 : t).toFixed(3)));
let uid = 0;
// one spectrum panel: grid, x axis, noise, reference lines, ghost and signals, direct labels
function panel(o, stage, c) {
const { lay, ax, X, F, P, sigs, ghost, nf, refs, title, clip, labelsBig, mask } = c;
const { L, R } = lay, yr = stage.y, tk = lay.big ? 4 : 3;
const Y = (db) => P[1] - (Math.max(yr[0], Math.min(yr[1], db)) - yr[0]) / (yr[1] - yr[0]) * (P[1] - P[0]);
o.push('<text class="pl" x="' + L + '" y="' + (P[0] - (lay.big ? 12 : 8)) + '">' + esc(title) + '</text>');
const gstep = P[1] - P[0] < 90 ? 40 : 20;
for (let g = Math.ceil(yr[0] / gstep) * gstep; g <= yr[1]; g += gstep) {
o.push('<line class="grid" x1="' + L + '" x2="' + R + '" y1="' + Y(g) + '" y2="' + Y(g) + '"/><text class="tk" x="' + (L - 7) + '" y="' + (Y(g) + tk) + '" text-anchor="end">' + g + '</text>');
}
o.push('<line class="axis" x1="' + L + '" x2="' + R + '" y1="' + P[1] + '" y2="' + P[1] + '"/>');
ax.ticks.forEach((t, i) => {
const last = i === ax.ticks.length - 1, x = X(t), lbl = tickLabel(t, ax);
if (x < L - 0.5 || x > R + 0.5) return;
const an = last && x > R - 30 ? 'end' : 'middle';
o.push('<line class="axis" x1="' + x + '" x2="' + x + '" y1="' + P[1] + '" y2="' + (P[1] + 4) + '"/><text class="tk" x="' + x + '" y="' + (P[1] + lay.tickDy) + '" text-anchor="' + an + '">' + lbl + (!/GHz/.test(lbl) && (last || (ax.unit === 'MHz' && ax.ticks[i + 1] >= 1000)) ? ' ' + ax.unit : '') + '</text>');
});
o.push('<g clip-path="url(#' + clip + ')">');
// where the AM and FM broadcast bands are, on RF-scale charts
const bandLabels = [];
if (ax.unit === 'MHz' && !c.noBands) {
for (const [a, b, name] of [[0.53, 1.7, 'AM band'], [87.5, 108, 'FM band']]) {
if (b < ax.min || a > ax.max) continue;
const x1 = X(Math.max(a, ax.min)), x2 = X(Math.min(b, ax.max));
if (x2 - x1 < 12 || x2 - x1 > (R - L) * 0.9) continue;
o.push('<rect class="bandmark" x="' + x1.toFixed(1) + '" y="' + P[0] + '" width="' + (x2 - x1).toFixed(1) + '" height="' + (P[1] - P[0]) + '"/>');
bandLabels.push([(x1 + x2) / 2, name]);
}
}
for (const [f, lab, cls] of refs || []) {
if (f < ax.min || f > ax.max) continue;
o.push('<line class="ref' + (cls ? ' ' + cls : '') + '" x1="' + X(f) + '" x2="' + X(f) + '" y1="' + P[0] + '" y2="' + P[1] + '"/><text class="refl' + (cls ? ' ' + cls : '') + '" x="' + (X(f) + 4) + '" y="' + (cls ? P[0] + (lay.big ? 12 : 9) : P[1] - 5) + '">' + esc(lab) + '</text>');
}
// the part being applied, laid over the spectrum: the shaded depth is how far the spectrum drops
if (mask && mask.kind === 'filter') {
const ppd = (P[1] - P[0]) / (yr[1] - yr[0]), pts = [];
for (let x = L; x <= R + 0.01; x += lay.step) pts.push(x.toFixed(1) + ',' + (P[0] + Math.min(P[1] - P[0], Math.max(0, -mask.H(F(x))) * ppd)).toFixed(1));
o.push('<g class="mask" style="opacity:' + mask.alpha.toFixed(2) + '"><path class="maskfill" d="M' + L + ',' + P[0] + 'L' + pts.join('L') + 'L' + R + ',' + P[0] + 'Z"/><path class="maskline" d="M' + pts.join('L') + '"/></g>');
}
let tr = [];
// the continuous spectrum, as an analyser draws it: noise plus every signal, power-summed at each pixel.
// A signal narrower than a few pixels is drawn a few pixels wide (the analyser's resolution bandwidth).
const trace = (list, nfun) => {
const comps = [];
for (const s of list || []) {
const op = s._op == null ? 1 : Math.max(0, s._op);
if (op <= 0.001) continue;
if (s.band) { if (s.band[1] >= ax.min && s.band[0] <= ax.max) comps.push({ s, op, b0: X(Math.max(s.band[0], ax.min)), b1: X(Math.min(s.band[1], ax.max)) }); continue; }
if (s.f <= 0) continue;
const xc = X(s.f), hw = Math.max(lay.big ? 3 : 2.5, s.bw ? Math.abs(X(s.f + s.bw / 2) - xc) : 0);
if (xc + 8 * hw < L || xc - 8 * hw > R) continue;
comps.push({ s, op, xc, hw });
}
const pts = [];
for (let x = L; x <= R + 0.01; x += lay.step) {
const f = F(x);
const np = nfun ? Math.pow(10, nfun(f) / 10) : 1e-30;
let tot = np, best = null, bp = 0;
for (const c of comps) {
let d;
if (c.s.band) {
const lev = (ff) => (c.s.lev ? c.s.lev(ff) : c.s.db);
d = x < c.b0 ? lev(c.s.band[0]) - 3 - 10 * (c.b0 - x) : x > c.b1 ? lev(c.s.band[1]) - 3 - 10 * (x - c.b1) : lev(f);
} else {
const a = Math.abs(x - c.xc) / c.hw;
if (a > 8) continue;
d = c.s.db - (a <= 1 ? 3 * a * a : 3 + 30 * (a - 1));
}
const pw = Math.pow(10, d / 10) * c.op;
tot += pw;
if (pw > bp) { bp = pw; best = c.s; }
}
pts.push([x, Y(10 * lg(tot)), bp > np && bp > 0.2 * tot ? best : null]);
}
return pts;
};
const line = (pts) => 'M' + pts.map((p) => p[0].toFixed(1) + ',' + p[1].toFixed(1)).join('L');
if (ghost && ghost.length) o.push('<path class="gtrace" d="' + line(trace(ghost, c.ghostNf || nf)) + '"/>');
tr = trace(sigs, nf);
if (tr.length) {
o.push('<path class="tfill" d="M' + L + ',' + P[1] + 'L' + line(tr).slice(1) + 'L' + R + ',' + P[1] + 'Z"/>');
o.push('<path class="tline" d="' + line(tr) + '"/>');
// colour each stretch by the signal that dominates it
let run = [], who = null;
const flush = () => {
if (who && run.length > 1) o.push('<g class="sg k-' + who.kind + '" data-sid="' + esc(who.id.split(':')[0]) + '"><path class="line" d="' + line(run) + '"/></g>');
run = []; who = null;
};
for (let i = 0; i < tr.length; i++) {
const p = tr[i];
if (p[2] !== who) { const prev = tr[i - 1]; flush(); who = p[2]; if (who && prev) run.push(prev); }
if (who) run.push(p);
}
flush();
// a dot on top of your station's peak
for (const s of sigs || []) {
if (s.kind !== 'station' || s.harm || s.band || s.dc || s.f < ax.min || s.f > ax.max || s.db < yr[0] + 10 || (s._op != null && s._op < 0.5)) continue;
o.push('<g class="sg k-station" data-sid="' + esc(s.id.split(':')[0]) + '"><circle class="cap" cx="' + X(s.f).toFixed(1) + '" cy="' + Y(s.db).toFixed(1) + '" r="' + (lay.big ? 4.5 : 3.5) + '"/></g>');
}
}
const order = { other: 0, mark: 1, sub: 1, image: 2, station: 3 };
const sorted = (sigs || []).slice().sort((a, b) => (order[a.kind] || 0) - (order[b.kind] || 0));
o.push('</g>');
for (const [x, name] of bandLabels) o.push('<text class="bandlbl" x="' + x.toFixed(1) + '" y="' + (P[0] + (lay.big ? 13 : 10)) + '" text-anchor="middle">' + name + '</text>');
// direct labels: your station and the image (the big chart also names the other strong signals)
const lab = [];
const vis = (s) => (s.band ? s.band[1] >= ax.min && s.band[0] <= ax.max : s.f >= ax.min && s.f <= ax.max && s.db >= yr[0] + 10);
const stS = sorted.filter((s) => s.kind === 'station' && !s.harm && !s.dc && vis(s)).sort((a, b) => b.db - a.db)[0];
const imS = sorted.filter((s) => s.kind === 'image' && vis(s)).sort((a, b) => b.db - a.db)[0];
const put = (s, text, side, cls) => {
if (!s) return;
const xc = s.band ? (Math.max(s.band[0], ax.min) + Math.min(s.band[1], ax.max)) / 2 : s.f;
const x = X(xc);
let yv = Y(s.lev ? s.lev(xc) : s.db);
for (const p of tr) if (Math.abs(p[0] - x) <= 6 && p[1] < yv) yv = p[1];
if (side) {
o.push('<text class="dl' + (cls || '') + '" x="' + (x + 9) + '" y="' + Math.min(P[1] - 5, Math.max(P[0] + 10, yv + 4)) + '" text-anchor="start">' + esc(text) + '</text>');
return;
}
let y = yv - (lay.big ? 11 : 9);
// a band name already sits there: put the label beside the peak instead
const by = P[0] + (lay.big ? 13 : 10);
if (!cls && bandLabels.some(([bx, n]) => Math.abs(bx - x) < (n.length + text.length) * (lay.big ? 3.6 : 3) && Math.abs(Math.max(P[0] + 10, y) - by) < 13)) {
o.push('<text class="dl" x="' + (x + 9) + '" y="' + Math.min(P[1] - 5, Math.max(by + 14, yv + 10)) + '" text-anchor="start">' + esc(text) + '</text>');
return;
}
for (const p of lab) if (Math.abs(p[0] - x) < (lay.big ? 90 : 70) && Math.abs(p[1] - y) < (lay.big ? 15 : 12)) y = p[1] - (lay.big ? 16 : 13);
lab.push([x, y]);
const hw = text.length * (lay.big ? 3.4 : 2.8);
const an = x < L + 50 ? 'start' : x > R - 50 ? 'end' : 'middle', xt = an === 'middle' ? Math.max(L + hw, Math.min(R - hw, x)) : x;
o.push('<text class="dl' + (cls || '') + '" x="' + xt.toFixed(1) + '" y="' + Math.max(P[0] + 10, y) + '" text-anchor="' + an + '">' + esc(text) + '</text>');
};
if (!c.noStation) put(stS, stS && stS.band ? 'audio' : 'your station');
// notes the caller pins to a frequency (the mixer's two copies)
for (const [f, text, db] of c.notes || []) { if (f >= ax.min && f <= ax.max) put({ f, db, kind: 'note' }, text); }
if (mask) {
const txt = mask.kind === 'gain' ? mask.label + ': every signal moves up ' + (mask.H(0) >= 0 ? '+' : '\u2212') + Math.abs(mask.H(0)).toFixed(0) + ' dB'
: mask.label + ': the shaded depth is how far the spectrum drops';
o.push('<text class="masklabel" x="' + (L + 8) + '" y="' + (P[0] + (bandLabels.length ? (lay.big ? 34 : 26) : lay.big ? 16 : 12)) + '" style="opacity:' + mask.alpha.toFixed(2) + '">' + (mask.kind === 'gain' ? '\u2191 ' : '') + esc(txt) + '</text>');
}
put(imS, 'image', !!(stS && imS && Math.abs(X(stS.f) - X(imS.f)) < 30));
if (labelsBig && lay.big) {
const others = sorted.filter((s) => s !== stS && s !== imS && vis(s) && !s.sum && (s.kind === 'sub' || s.kind === 'other' || s.harm)).sort((a, b) => b.db - a.db).slice(0, 4);
for (const s of others) {
const x = X(s.band ? (Math.max(s.band[0], ax.min) + Math.min(s.band[1], ax.max)) / 2 : s.f);
if (lab.some((p) => Math.abs(p[0] - x) < 110)) continue;
put(s, s.label.length > 34 ? s.label.slice(0, 32) + '…' : s.label, false, ' minor');
}
}
}
const ease = (t) => (t <= 0 ? 0 : t >= 1 ? 1 : t * t * (3 - 2 * t));
// between two spectra: matching signals move, new ones fade in, vanished ones fade out
function lerpSigs(from, to, e) {
const fm = new Map((from || []).map((x) => [x.id, x]));
const out = [];
for (const b of to || []) {
const a = fm.get(b.id);
if (!a) { out.push(Object.assign({}, b, { _op: e })); continue; }
fm.delete(b.id);
const o = Object.assign({}, b, { db: a.db + (b.db - a.db) * e });
if (b.lev || a.lev) o.lev = ((la, lb) => (f) => la(f) + (lb(f) - la(f)) * e)(a.lev || (() => a.db), b.lev || (() => b.db));
out.push(o);
}
for (const a of fm.values()) out.push(Object.assign({}, a, { _op: 1 - e }));
return out;
}
// what to draw: the finished stage, or one step of its animation (opt.anim = { k, t })
function viewOf(stage, opt) {
const base = { sig: stage.out.sig, nf: stage.out.nf, ghost: stage.ghost && stage.ghost.sig, ghostNf: stage.ghost && stage.ghost.nf, mask: null, resp: stage.resp, step: null, mixT: 1 };
const A = opt && opt.anim;
if (!A || !stage.steps || !stage.steps[A.k]) return base;
const step = stage.steps[A.k], t = A.t;
if (stage.inp) {
if (step.kind === 'in') return Object.assign(base, { mixT: 0, step });
if (step.kind === 'mix') return Object.assign(base, { mixT: ease(t / 0.9), step });
return Object.assign(base, { step });
}
if (step.kind === 'in') return { sig: step.to.sig, nf: step.to.nf, ghost: null, mask: null, resp: null, step, mixT: 1 };
if (step.kind === 'filter' || step.kind === 'gain') {
const e = ease((t - 0.35) / 0.45), fr = step.from, to = step.to;
return { sig: lerpSigs(fr.sig, to.sig, e), nf: (f) => fr.nf(f) + (to.nf(f) - fr.nf(f)) * e, ghost: fr.sig, ghostNf: fr.nf, step, mixT: 1,
mask: { H: step.H, alpha: Math.min(1, t / 0.3), kind: step.kind, label: step.name }, resp: { H: step.H, y: stage.resp ? stage.resp.y : [-60, 20] } };
}
const e = ease(t / 0.8), fr = step.from || { sig: [], nf: () => -300 }, to = step.to;
return { sig: lerpSigs(fr.sig, to.sig, e), nf: (f) => fr.nf(f) + (to.nf(f) - fr.nf(f)) * e, ghost: null, mask: null, resp: null, step, mixT: 1 };
}
// the wide axis of a mixer's top panel, with ticks to suit the width
function wideAx(stage, lay) {
const b = stage.inAx;
if (!lay.big) return b;
const st = niceStep(b.max - b.min, Math.max(4, Math.round((lay.W - 90) / 95))), ticks = [];
for (let t = Math.ceil(b.min / st) * st; t <= b.max + 1e-9; t += st) ticks.push(+t.toFixed(6));
return Object.assign({}, b, { ticks });
}
// the mixer's copies part-way (e = 0 \u2192 1): the sum copy moves up by e\u00b7LO, the difference copy down, folding back at 0 Hz
const moved = (stage, e) => stage.prod.sig.map((p) => {
if (p.from == null) return p;
const f = p.sum ? p.from + stage.lo * e : Math.abs(p.from - stage.lo * e);
return Object.assign({}, p, { f, db: p.db0 - 3 + (p.db - p.db0 + 3) * e });
});
function render(stage, idx, opt) {
const mix = !!stage.inp;
const lay = layout(opt, mix), ax = axisFor(stage, opt), { X, F } = scales(ax, lay);
const { W, H, L, R, SP } = lay;
const V = viewOf(stage, opt);
const clip = 'sc' + (++uid);
const o = [];
o.push('<svg class="stg' + (lay.big ? ' big' : '') + (mix ? ' mixer' : '') + '" viewBox="0 0 ' + W + ' ' + H + '"' + (lay.big ? ' width="' + W + '" height="' + H + '"' : '') + ' role="img" aria-label="' + esc(stage.title + (mix ? ': spectrum before and after the mixer' : ': spectrum after this stage')) + '" data-stage="' + esc(stage.id) + '">');
o.push('<defs><clipPath id="' + clip + '"><rect x="' + L + '" y="0" width="' + (R - L) + '" height="' + H + '"/></clipPath></defs>');
const tk = lay.big ? 4 : 3;
let mixSig = null, mixNf = null;
if (mix) {
// the whole picture on one wide axis: what goes in, the LO, and the two copies the multiplication makes.
// While it plays, every copy slides from its input frequency: down by the LO (folding back at 0 Hz) or up by it.
const wax = wideAx(stage, lay), sw = scales(wax, lay), e = V.mixT;
const sigs = e > 0 ? moved(stage, e) : stage.inp.sig;
const nfW = e <= 0 ? stage.inp.nf : e >= 1 ? stage.prod.nf : (f) => stage.inp.nf(f) + (stage.prod.nf(f) - stage.inp.nf(f)) * e;
const notes = [];
if (e >= 1) {
const d = stage.prod.sig.find((x) => x.kind === 'station' && !x.sum), u = stage.prod.sig.find((x) => x.kind === 'station' && x.sum);
if (d) notes.push([d.f, stage.notes.diff, d.db]);
if (u) notes.push([u.f, stage.notes.sum, u.db]);
}
const fit = (t) => { const n = Math.floor((R - L) / (lay.big ? 7.6 : 6.1)); return t.length > n ? t.slice(0, n - 1) + '\u2026' : t; };
const title = fit(V.step ? 'Step ' + (stage.steps.indexOf(V.step) + 1) + ': ' + V.step.title
: 'Everything the mixer makes (' + stage.yUnit + '): the input, copied down and up by the LO');
panel(o, stage, { lay, ax: wax, X: sw.X, F: sw.F, P: lay.IP, sigs, ghost: e > 0 ? stage.inp.sig : null, ghostNf: stage.inp.nf, nf: nfW,
refs: [[stage.lo, 'LO ' + fmtF(stage.lo), 'lo']], clip, labelsBig: false, noStation: e > 0, notes, noBands: stage.noBands, title });
// the part the bottom panel magnifies, and the two lines that say so
let x1 = sw.X(Math.max(ax.min, wax.min)), x2 = sw.X(Math.min(ax.max, wax.max));
if (x2 - x1 < 5) { const xc = (x1 + x2) / 2; x1 = xc - 2.5; x2 = xc + 2.5; }
const IP = lay.IP, yt = SP[0] - (lay.big ? 30 : 22), yd = IP[1] + lay.tickDy + 6;
o.push('<g class="zoom"><rect class="zoombox" x="' + x1.toFixed(1) + '" y="' + IP[0] + '" width="' + (x2 - x1).toFixed(1) + '" height="' + (IP[1] - IP[0]) + '"/>' +
'<path class="zoomline" d="M' + x1.toFixed(1) + ',' + IP[1] + 'V' + yd + 'L' + L + ',' + yt + 'M' + x2.toFixed(1) + ',' + IP[1] + 'V' + yd + 'L' + R + ',' + yt + '"/></g>');
if (e < 1) { mixSig = moved(stage, e); mixNf = (f) => stage.inp.nf(f) + (stage.out.nf(f) - stage.inp.nf(f)) * e; }
} else if (V.resp) {
const RP = lay.RP, ry = V.resp.y, RY = (g) => RP[1] - (Math.max(ry[0], Math.min(ry[1], g)) - ry[0]) / (ry[1] - ry[0]) * (RP[1] - RP[0]);
o.push('<text class="pl" x="' + L + '" y="' + (RP[0] - (lay.big ? 12 : 8)) + '">' + (V.step ? 'This step applies: ' + esc(V.step.title) + ' (dB)' : 'What this stage applies: gain (dB)') + '</text>');
const rt = [ry[0], 0, ry[1]].filter((v, k, a) => a.indexOf(v) === k && v >= ry[0] && v <= ry[1] && (v === 0 || ry[0] > 0 || ry[1] < 0 || Math.abs(RY(v) - RY(0)) >= 12));
for (const g of rt) {
o.push('<line class="grid' + (g === 0 ? ' zero' : '') + '" x1="' + L + '" x2="' + R + '" y1="' + RY(g) + '" y2="' + RY(g) + '"/><text class="tk" x="' + (L - 7) + '" y="' + (RY(g) + tk) + '" text-anchor="end">' + (g > 0 ? '+' : '') + g + '</text>');
}
const pts = [];
for (let x = L; x <= R + 0.01; x += lay.step) pts.push([x, RY(V.resp.H(F(x)))]);
o.push('<g clip-path="url(#' + clip + ')"><path class="rarea" d="M' + L + ',' + RP[1] + 'L' + pts.map((p) => p[0].toFixed(1) + ',' + p[1].toFixed(1)).join('L') + 'L' + R + ',' + RP[1] + 'Z"/>');
o.push('<path class="rline" d="M' + pts.map((p) => p[0].toFixed(1) + ',' + p[1].toFixed(1)).join('L') + '"/></g>');
} else if (V.step || stage.strip) {
const RP = lay.RP;
o.push('<foreignObject x="' + L + '" y="' + (RP[0] - (lay.big ? 20 : 16)) + '" width="' + (R - L) + '" height="' + (RP[1] - RP[0] + (lay.big ? 30 : 22)) + '"><div xmlns="http://www.w3.org/1999/xhtml" class="strip' + (V.step ? ' stepnow' : '') + '">' + esc(V.step ? V.step.title : stage.strip) + '</div></foreignObject>');
}
panel(o, stage, { lay, ax, X, F, P: SP, sigs: mixSig || V.sig, ghost: V.ghost, ghostNf: V.ghostNf, nf: mixNf || V.nf, refs: stage.refs, clip, labelsBig: !V.step, mask: V.mask,
title: mix ? 'Magnified: signal out around the IF (' + stage.yUnit + ')' : 'Signal out (' + stage.yUnit + ')' });
const top = mix ? lay.IP[0] : lay.RP[0];
o.push('<line class="xhair" x1="0" x2="0" y1="' + top + '" y2="' + SP[1] + '" visibility="hidden"/>');
o.push('<rect class="hov" x="' + L + '" y="' + (top - 6) + '" width="' + (R - L) + '" height="' + (SP[1] - top + 12) + '" data-i="' + idx + '"/>');
o.push('</svg>');
return o.join('');
}
// nearest signal to a pointer (viewBox units). On a mixer, y picks the panel: above the connectors is the input.
function pick(stage, x, opt, y) {
const mix = !!stage.inp;
const lay = layout(opt, mix);
const inPanel = mix && y != null && y < lay.MZ[0] + (lay.MZ[1] - lay.MZ[0]) / 2;
const ax = inPanel ? wideAx(stage, lay) : axisFor(stage, opt), { X, F } = scales(ax, lay);
const list = inPanel ? stage.prod.sig : stage.out.sig;
const lim = lay.big ? 22 : 18;
const cand = [];
for (const s of list || []) {
if (!s.band && (s.db < stage.y[0] || s.f < ax.min || s.f > ax.max)) continue;
const xc = s.band ? Math.min(Math.max(x, X(s.band[0])), X(s.band[1])) : X(s.f);
const d = Math.abs(xc - x);
if (d < lim) cand.push({ s, d, x: s.band ? x : xc });
}
cand.sort((a, b) => a.d - b.d);
// signals within 3 px of the nearest one share the spot: the strongest leads, the rest are listed
const near = cand.filter((c) => cand.length && c.d - cand[0].d < 3).sort((a, b) => b.s.db - a.s.db);
const best = near[0] || null;
const f = best ? (best.s.band ? F(x) : best.s.f) : F(x);
const val = best ? (best.s.lev ? best.s.lev(f) : best.s.db) : null;
const to = null;
const nfun = inPanel ? stage.prod.nf : stage.out.nf;
return { sig: best && best.s, also: near.slice(1).map((c) => c.s), val, x: best ? best.x : x, f, to, panel: inPanel ? 'in' : 'out', unit: ax.unit,
y1: inPanel ? lay.IP[0] : mix ? lay.SP[0] : (lay.RP ? lay.RP[0] : lay.SP[0]), y2: inPanel ? lay.IP[1] : lay.SP[1],
gain: !inPanel && stage.resp ? stage.resp.H(f) : null, floor: nfun ? nfun(f) : null };
}
// frequency at a viewBox x on the output axis (for zoom and pan)
function fAt(stage, opt, x) { const lay = layout(opt, !!stage.inp); return scales(axisFor(stage, opt), lay).F(Math.max(lay.L, Math.min(lay.R, x))); }
const layoutOf = (stage, opt) => layout(opt, !!stage.inp);
return { build, render, pick, fAt, layout: layoutOf, fmtF, plan, IF1, control, vco, tankF, pwmV, dacV, CTL0,
resp: { fmLeg, amLeg, tank, cer10, cer455, rc1, sallenKey, deemph, fir, notch19 } };
})();
if (typeof module === 'object' && module.exports) module.exports = SPECTRUM;
// Waveform view ("scope") for the stages after the last IF filter: what an oscilloscope on that node would show.
// The audio stages are built from the same signals the spectra use (programme tones, the 19 kHz pilot, the
// L−R stereo signal, RDS, noise), and each step applies the stage's own response H(f) to them, so the
// waveform and the spectrum always agree. The limiter and squarer are drawn at the real 455 kHz IF; where a
// window holds too many cycles to draw (the detector's input), the panel says how it is drawn.
var SCOPE = (function () {
const TAU = 2 * Math.PI;
const lg = (x) => Math.log10(Math.max(x, 1e-30));
const db2a = (db) => Math.pow(10, db / 20);
const ease = (t) => (t <= 0 ? 0 : t >= 1 ? 1 : t * t * (3 - 2 * t));
const esc = (s) => String(s).replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"');
const rc1 = (fMHz, fcMHz) => -10 * lg(1 + Math.pow(fMHz / fcMHz, 2));
const IDS = { fm: ['lim', 'sq', 'pump', 'fmaud', 'dsp'], am: ['det', 'agc', 'dsp'] };
const has = (st) => !!(st && st.td && (IDS.fm.indexOf(st.id) >= 0 || IDS.am.indexOf(st.id) >= 0));
// deterministic noise: the same picture every time
function rng(seed) { let s = seed >>> 0 || 1; return () => { s ^= s << 13; s >>>= 0; s ^= s >>> 17; s ^= s << 5; s >>>= 0; return s / 4294967296; }; }
// ------------------------------------------------------------------ signals as lists of tones
// a tone: f in Hz, a = peak amplitude, ph = phase. Responses H take MHz, as in spectrum.js.
const tone = (f, a, ph, kind) => ({ f, a, ph: ph || 0, kind: kind || 'station' });
const sumAt = (cs, t) => { let v = 0; for (const c of cs) v += c.a * Math.cos(TAU * c.f * t + c.ph); return v; };
const scaleBy = (cs, H, e) => cs.map((c) => Object.assign({}, c, { a: c.a * db2a(H(c.f / 1e6) * e) }));
const times = (cs, k) => cs.map((c) => Object.assign({}, c, { a: c.a * k }));
const chain = (cs, Hs) => (Hs || []).reduce((acc, H) => scaleBy(acc, H, 1), cs);
// noise: many tones of random phase with a given spectral shape, scaled to an rms
function noise(seed, f0, f1, n, shape, rms) {
const r = rng(seed), cs = [];
for (let i = 0; i < n; i++) { const f = f0 + (f1 - f0) * (i + r()) / n; cs.push(tone(f, shape(f), TAU * r(), 'noise')); }
const p = cs.reduce((s, c) => s + c.a * c.a / 2, 0);
return times(cs, rms / Math.sqrt(p || 1));
}
// the programme: a chord, the part that differs between left and right, normalised to a peak of 1
const PROG = [[523.25, 1, 0.3], [784, 0.6, 1.1], [1568, 0.35, 2.0], [3136, 0.2, 0.7], [6272, 0.1, 2.6]];
const PROG2 = [[659.3, 1, 0.9], [1975.5, 0.5, 2.2]];
const PSUM = PROG.reduce((s, p) => s + p[1], 0), PSUM2 = PROG2.reduce((s, p) => s + p[1], 0);
const prog = (peak, set, sum) => set.map(([f, a, ph]) => tone(f, peak * a / sum, ph));
// FM: the multiplex out of the pulse-count detector, volts around FM_DEMOD's DC (1.8 V).
// FM_DEMOD = VREF_FM − I·51k: more cycles per second, more current, a LOWER voltage (the integrator inverts).
const K_FM = 0.34 / 75; // volts peak per kHz of deviation (as spectrum.js)
const preemph = (fHz) => 10 * lg(1 + Math.pow(fHz * TAU * 76.5e-6, 2)); // the transmitter's 76.5 µs boost (dB)
function fmMpx(td) {
if (!td.carrier) return fmNoise(td);
const cs = [];
for (const c of prog(45, PROG, PSUM)) cs.push(tone(c.f, -K_FM * c.a * db2a(preemph(c.f)), c.ph)); // L+R
cs.push(tone(19000, -K_FM * 7.5, 0.4, 'sub')); // pilot
for (const c of prog(14, PROG2, PSUM2)) { // L−R on 38 kHz
const a = -K_FM * c.a * db2a(preemph(c.f)) / 2;
cs.push(tone(38000 - c.f, a, -c.ph + 0.8, 'sub'), tone(38000 + c.f, a, c.ph + 0.8, 'sub'));
}
cs.push(tone(57000 - 1187.5, -K_FM * 1, 1.3, 'sub'), tone(57000 + 1187.5, -K_FM * 1, 2.9, 'sub')); // RDS
return cs.concat(fmNoise(td));
}
// the detector's noise rises with frequency (the FM triangle); spectrum.js puts it at N0 + 20·log(f / 1 kHz) per kHz
function fmNoise(td) {
let p = 0;
for (let k = 1; k <= 60; k++) p += Math.pow(10, (td.N0 + 20 * lg(k)) / 10);
return noise(7, 300, 60000, 120, (f) => f, Math.sqrt(p));
}
// AM: the audio on the detector output, volts around its 1.0 V DC: 30 % modulation, plus the neighbours' whistles
function amAudio(td) {
if (!td.carrier) return [];
return prog(0.3, PROG.slice(0, 4), PSUM - 0.1).concat((td.wh || []).map((w, i) => tone(w.f, db2a(w.rel), 0.7 + i, 'other')));
}
// ------------------------------------------------------------------ where each step is
// opt.anim = {k, t}: steps before k are applied, step k is part-way (e), later ones not yet. No anim: all applied.
function progress(stage, opt) {
const A = opt && opt.anim, steps = stage.steps || [];
if (!A || !steps[A.k]) return { e: steps.map(() => 1), step: null, k: steps.length };
const step = steps[A.k];
const cur = step.kind === 'filter' || step.kind === 'gain' ? ease((A.t - 0.35) / 0.45) : step.kind === 'in' ? 1 : ease(A.t / 0.8);
return { e: steps.map((_, j) => (j < A.k ? 1 : j === A.k ? cur : 0)), step, k: A.k };
}
const idxOf = (stage, kind, name) => (stage.steps || []).findIndex((s) => s.kind === kind && (!name || s.name === name));
// ------------------------------------------------------------------ the stages
// Each returns { T: window (s), unit, panels: [...], note }. A panel: { title, y: [lo, hi], unit, ticks?, refs, traces, label }.
// A trace: { kind: 'line' | 'band' | 'dots' | 'pulses', t: [...], v: [...] (band: lo, hi), cls, upto }.
function grid(T, n) { const t = new Float64Array(n); for (let i = 0; i < n; i++) t[i] = T * i / (n - 1); return t; }
const sample = (t, fn) => Array.from(t, fn);
// the IF at the limiter: the station, its noise, and what is left of the 10 MHz products before the RC
function limInput(td) {
const f = td.fIF * 1e6 + 30e3; // the IF right now: 30 kHz of deviation at this instant
const A = td.carrier ? Math.SQRT2 * db2a(td.pre) : 0;
const N = db2a(td.noise); // rms
const cs = (td.carrier ? [tone(f, A, 0.2)] : []).concat(noise(11, 0.455e6 - 90e3, 0.455e6 + 90e3, 40, () => 1, N));
const ref = td.carrier ? A : 2 * N;
cs.push(tone(10.695e6, 0.6 * ref, 1.0, 'other'), tone(20.935e6, 0.4 * ref, 2.1, 'other'));
return cs;
}
// the limiter: 66 dB of gain into Q702, which clips between saturation (0.7 V) and cut-off (4.9 V); C710 rounds the edges
function limOut(x, G, dt) {
const out = new Array(x.length);
let y = null;
const k = dt / 103e-9;
for (let i = 0; i < x.length; i++) {
const u = -G * x[i];
const v = 2.6 + (u > 0 ? 2.3 * Math.tanh(u / 2.3) : 1.9 * Math.tanh(u / 1.9));
y = y == null ? v : y + Math.min(1, k) * (v - y);
out[i] = y;
}
return out;
}
function S_lim(stage, opt, n) {
const td = stage.td, P = progress(stage, opt), T = 20e-6, t = grid(T, n * 4), dt = T / (t.length - 1);
const iRc = idxOf(stage, 'filter'), iClip = idxOf(stage, 'convert');
const cs0 = limInput(td);
const raw = sample(t, (x) => sumAt(cs0, x));
const filtered = scaleBy(cs0, (f) => rc1(f, 0.482), 1);
const csNow = scaleBy(cs0, (f) => rc1(f, 0.482), iRc >= 0 ? P.e[iRc] : 1);
const xin = sample(t, (x) => sumAt(csNow, x));
const xf = iRc >= 0 && P.e[iRc] < 1 ? sample(t, (x) => sumAt(filtered, x)) : xin;
const ec = iClip >= 0 ? P.e[iClip] : 1;
const G = Math.pow(10, 66 / 20 * ec);
const span = Math.max(...raw.map(Math.abs)) * 1.15;
const mv = span < 0.5;
const s = mv ? 1000 : 1;
const out = ec > 0 ? limOut(xf, G, dt) : null;
const panels = [
{ title: 'In: the IF on R702 / C704 (' + (mv ? 'mV' : 'V') + ')' + (P.k === 0 && P.step ? ', with the 10.7 and 20.9 MHz products still on it' : ''),
y: [-span * s, span * s], unit: mv ? 'mV' : 'V',
traces: [{ kind: 'line', t, v: xin.map((v) => v * s), cls: 'tr' }] },
{ title: 'Out: Q702 collector, LIM2_C (V)', y: [0, 5.2], unit: 'V',
refs: [[4.9, 'cut off: V_IF4, 4.9 V'], [2.6, ec > 0 ? '' : 'at rest: 2.6 V'], [0.7, 'saturated: 0.7 V']],
traces: out ? [{ kind: 'line', t, v: out, cls: 'tr' }] : [{ kind: 'line', t: [0, T], v: [2.6, 2.6], cls: 'tr faint' }],
label: ec > 0 ? 'gain ×' + Math.round(G).toLocaleString('en-US') + ' (+' + (20 * lg(G)).toFixed(0) + ' dB)' : '' },
];
const note = td.carrier ? (td.capt ? 'A stronger neighbour has captured the limiter: this is its IF.' : '') : 'No carrier: the limiter clips the noise itself, so it comes out at full level. That is the hiss between stations.';
return { T, unit: 'µs', panels, note };
}
function S_sq(stage, opt, n) {
const td = stage.td, P = progress(stage, opt), T = 20e-6, t = grid(T, n * 3), dt = T / (t.length - 1);
const cs = scaleBy(limInput(td), (f) => rc1(f, 0.482), 1);
const lim = limOut(sample(t, (x) => sumAt(cs, x)), Math.pow(10, 66 / 20), dt);
// Q703: on above about 2.2 V, pulling LIM_SQ to 0.1 V; off, R715 and R716 + R717 leave 4.6 V. It inverts.
let y = null;
const sq = lim.map((v) => { const target = v > 2.2 ? 0.1 : 4.6; y = y == null ? target : y + Math.min(1, dt / 12e-9) * (target - y); return y; });
const e = P.e[idxOf(stage, 'convert')];
return { T, unit: 'µs', panels: [
{ title: 'In: LIM2_C, the limiter’s output (V)', y: [0, 5.2], unit: 'V', refs: [[2.2, 'Q703 switches at 2.2 V', 'thr']], traces: [{ kind: 'line', t, v: lim, cls: 'tr soft' }] },
{ title: 'Out: LIM_SQ (V): Q703 inverts, so LIM2_C high means LIM_SQ low', y: [0, 5.2], unit: 'V', refs: [[4.6, '4.6 V']],
traces: [{ kind: 'line', t, v: sq, cls: 'tr', upto: e * T }], sweep: e > 0 && e < 1 ? e * T : null },
], note: td.carrier ? '' : 'No carrier: the edges come from noise, at random.' };
}
// the pulse-count detector. Its input has about 1,820 cycles in this 4 ms window, so the top two panels slow it down.
function S_pump(stage, opt, n) {
const td = stage.td, P = progress(stage, opt), T = 4e-3, t = grid(T, n * 2);
const iConv = idxOf(stage, 'convert'), iDe = idxOf(stage, 'filter');
const eC = iConv >= 0 ? P.e[iConv] : 1, eD = iDe >= 0 ? P.e[iDe] : 1;
const mpx = fmMpx(td);
const deemph = stage.steps && stage.steps[iDe] ? stage.steps[iDe].H : (f) => rc1(f, 0.00208);
const cs = scaleBy(mpx, deemph, eD);
const dem = sample(t, (x) => 1.8 + sumAt(cs, x));
// slowed-down square wave: 6 cycles per ms at rest, swinging ±45 % with the programme (really ±16 % at most)
const aud = td.carrier ? prog(1, PROG, PSUM) : noise(5, 200, 3000, 30, () => 1, 0.5);
const r = rng(3);
let ph = 0, prev = 0;
const sqv = [], edges = [];
for (let i = 0; i < t.length; i++) {
const dtt = i ? t[i] - t[i - 1] : 0;
const f = 6000 * (1 + 0.45 * Math.max(-1, Math.min(1, sumAt(aud, t[i]))) + (td.carrier ? 0 : 0.6 * (r() - 0.5)));
ph += f * dtt;
const hi = (ph % 1) < 0.5;
sqv.push(hi ? 4.6 : 0.1);
if (i && Math.floor(ph) > prev) edges.push(t[i]);
prev = Math.floor(ph);
}
const upto = eC * T;
const yc = Math.max(0.12, Math.max(...Array.from(t, (x) => Math.abs(sumAt(mpx, x)))) * 1.15); // fixed while the de-emphasis plays
return { T, unit: 'ms', panels: [
{ title: 'LIM_SQ, drawn about 75× slower: its frequency carries the audio', y: [0, 5.2], unit: 'V', traces: [{ kind: 'line', t, v: sqv, cls: 'tr soft', upto }] },
{ title: 'Charge packets through C714 and D702: the same size, one per cycle', y: [0, 1.2], unit: '', noTicks: true, traces: [{ kind: 'pulses', t: edges, h: 1, w: 0.18 / 6000, cls: 'pk', upto }] },
{ title: 'FM_DEMOD (V), to scale: more cycles, more current, a lower voltage', y: [1.8 - yc, 1.8 + yc], unit: 'V',
refs: [[1.8, '1.8 V: the 455 kHz rest point']], traces: [{ kind: 'line', t, v: dem, cls: 'tr', upto }], sweep: eC > 0 && eC < 1 ? upto : null,
label: P.step && P.step.kind === 'filter' ? 'de-emphasis ' + Math.round(eD * 100) + ' %' : '' },
], note: td.carrier ? 'The top two panels are slowed down to show the edges: the real IF has about 1,820 cycles in these 4 ms, and its spacing changes by ±16 % at most. The bottom panel is to scale.'
: 'No carrier: the edges come at random, so the average is loud noise that rises with frequency: the hiss.' };
}
function S_fmaud(stage, opt, n) {
const td = stage.td, P = progress(stage, opt), T = 4e-3, t = grid(T, n * 2);
const iF = idxOf(stage, 'filter'), eF = iF >= 0 ? P.e[iF] : 1;
const inp = chain(fmMpx(td), td.pre);
const sk = stage.steps[iF].H;
const a = sample(t, (x) => 1.8 + sumAt(inp, x));
const outCs = scaleBy(inp, sk, eF);
const b = sample(t, (x) => 1.65 + sumAt(outCs, x));
const yc = Math.max(0.1, Math.max(...a.map((v) => Math.abs(v - 1.8))) * 1.15);
return { T, unit: 'ms', panels: [
{ title: 'In: FM_DEMOD after the de-emphasis (V)', y: [1.8 - yc, 1.8 + yc], unit: 'V', traces: [{ kind: 'line', t, v: a, cls: 'tr' }] },
{ title: 'Out: FMA_OUT (V), re-centred on 1.65 V for the ADC', y: [1.65 - yc, 1.65 + yc], unit: 'V', refs: [[1.65, '1.65 V: mid-scale']],
traces: [{ kind: 'line', t, v: b, cls: 'tr' }], label: P.step && P.step.kind === 'filter' ? 'Sallen-Key ' + Math.round(eF * 100) + ' %' : '' },
], note: 'The two-pole filter smooths the stereo signal but leaves most of the pilot; the microcontroller’s digital filter removes the rest.' };
}
// ADC + DSP: one millisecond is one USB packet
const softLim = (x) => { const a = Math.abs(x), k = db2a(-4); return a <= k ? x : Math.sign(x) * (k + (a - k) / 4); };
function S_dsp(stage, opt, n) {
const td = stage.td, P = progress(stage, opt), T = 2e-3;
const fsAmp = db2a(td.toFs) / Math.SQRT2; // volts peak -> full scale (1.64 V peak = full scale)
let vin, faultNoise = null;
if (td.band === 'fm') vin = chain(fmMpx(td), td.pre);
else if (td.fault) { vin = []; faultNoise = noise(9, 200, 20000, 60, () => 1, db2a(-38)).concat([1, 2, 3].map((k) => tone(k * 1000, db2a(-55) * Math.SQRT2, k, 'other'))); }
else vin = chain(amAudio(td), td.pre);
const hum = [tone(1000, db2a(-39) * Math.SQRT2, 0.5, 'other'), tone(3000, db2a(-50) * Math.SQRT2, 1.7, 'other')];
const fsIn = times(vin, fsAmp).concat(hum).concat(faultNoise || []); // what the ADC reads, in full scale
let cs = fsIn, gainDb = 0, mute = 1;
(stage.steps || []).forEach((s, j) => {
const e = P.e[j];
if (!e || s.kind === 'in') return;
if (s.kind === 'convert') mute *= 1 - e;
else if (s.kind === 'gain') gainDb += s.H(0.001) * e;
else cs = scaleBy(cs, s.H, e);
});
const iFir = idxOf(stage, 'filter');
const firOn = iFir < 0 || P.e[iFir] > 0;
const ta = grid(T, n * 2), t192 = grid(T - 1 / 192000, 384), t48 = grid(T - 1 / 48000, 96);
const g = db2a(gainDb) * mute;
const out48 = Array.from(t48, (x) => softLim(sumAt(cs, x) * g));
const ain = Array.from(ta, (x) => 1.65 + sumAt(vin, x) + (faultNoise ? sumAt(faultNoise, x) / fsAmp : 0));
// the axes follow the signal (fixed through the steps): the whole ADC range would make it a flat line
const va = Math.min(1.65, Math.max(0.12, Math.max(...ain.map((v) => Math.abs(v - 1.65))) * 1.25));
const full = Array.from(t48, (x) => softLim(sumAt(fsIn, x) * db2a(Math.max(0, (stage.steps || []).reduce((a, q) => a + (q.kind === 'gain' ? q.H(0.001) : 0), 0)))));
const vb = Math.min(1.05, Math.max(0.08, Math.max(...full.map(Math.abs)) * 1.25));
return { T, unit: 'ms', panels: [
{ title: 'ADC input, PA0 (V), and its samples: 192,000 a second', y: [1.65 - va, 1.65 + va], unit: 'V', refs: [[1.65, '1.65 V: mid-scale']],
traces: [{ kind: 'line', t: ta, v: ain, cls: 'tr soft' },
{ kind: 'dots', t: t192, v: Array.from(t192, (x) => 1.65 + sumAt(vin, x) + (faultNoise ? sumAt(faultNoise, x) / fsAmp : 0)), cls: 'dot sm' }] },
{ title: 'To the PC: 48,000 samples a second after the FIR' + (P.step && P.step.kind !== 'in' ? ' (' + P.step.name + ')' : '') + ', full scale ±1',
y: [-vb, vb], unit: 'FS', refs: gainDb > 0 ? [[db2a(-4), '−4 dBFS: the soft limiter starts'], [-db2a(-4), ''], [0, '']] : [[0, '']],
traces: firOn ? [{ kind: 'line', t: t48, v: out48, cls: 'tr' }, { kind: 'dots', t: t48, v: out48, cls: 'dot' }] : [] },
{ kind: 'usb', title: 'USB: one packet every millisecond, 48 samples × 16 bits, mono, to the PC', h: 34, packets: 2 },
], note: '' };
}
// AM: the 455 kHz IF has 910 cycles in this window, so it is drawn as the band between its peaks
function S_det(stage, opt, n) {
const td = stage.td, P = progress(stage, opt), T = 2e-3, t = grid(T, n * 2);
const iC = idxOf(stage, 'convert'), iF = idxOf(stage, 'filter');
const eC = iC >= 0 ? P.e[iC] : 1, eF = iF >= 0 ? P.e[iF] : 1;
const design = Object.assign({}, td, { carrier: true });
const audE = amAudio(td.fault ? design : td), live = td.carrier && !td.fault;
const env = (cs, x) => Math.max(0, 1.25 * (1 + sumAt(cs, x)));
const ghostEnv = td.fault ? Array.from(t, (x) => env(audE, x)) : null;
const detH = stage.steps && stage.steps[iF] ? stage.steps[iF].H : (f) => rc1(f, 0.00723);
const csOut = scaleBy(audE, detH, eF);
const det = Array.from(t, (x) => (live ? 1 + sumAt(csOut, x) : 0));
const envL = Array.from(t, (x) => (live ? env(audE, x) : 0.01));
const panels = [
{ title: 'In: AM_IFOUT (V): 910 IF cycles here, so the band shows their peaks', y: [-2.2, 2.2], unit: 'V',
traces: (ghostEnv ? [{ kind: 'band', t, lo: ghostEnv.map((v) => -v), hi: ghostEnv, cls: 'ghostband' }] : []).concat([{ kind: 'band', t, lo: envL.map((v) => -v), hi: envL, cls: 'band' }]) },
{ title: 'Out: AM_DET (V): D601 and C612 hold each peak, R619 lets it fall', y: [0, 1.8], unit: 'V', refs: [[1, live || td.fault ? 'the AGC holds the average at 1.0 V' : '']],
traces: (td.fault ? [{ kind: 'line', t, v: Array.from(t, (x) => 1 + sumAt(scaleBy(audE, detH, 1), x)), cls: 'tr ghost' }] : [])
.concat([{ kind: 'line', t, v: det, cls: 'tr', upto: eC * T }]), sweep: eC > 0 && eC < 1 ? eC * T : null },
];
return { T, unit: 'ms', panels, note: td.fault ? '' : !td.carrier ? 'No station: nothing to detect.' : loudWh(td) ? 'The fast ripple on the envelope is a neighbour 10 kHz away, beating with your carrier: a whistle.' : '' };
}
function S_agc(stage, opt, n) {
const td = stage.td, P = progress(stage, opt), T = 2e-3, t = grid(T, n * 2);
const iC = idxOf(stage, 'convert'), iF = idxOf(stage, 'filter');
const eC = iC >= 0 ? P.e[iC] : 1, eF = iF >= 0 ? P.e[iF] : 1;
const design = Object.assign({}, td, { carrier: true });
const inp = chain(amAudio(td.fault ? design : td), td.pre), live = td.carrier && !td.fault;
const sk = stage.steps && stage.steps[iF] ? stage.steps[iF].H : (f) => 0;
const outCs = scaleBy(inp, sk, eF);
const a = Array.from(t, (x) => (live ? 1 + sumAt(inp, x) : 0));
const b = Array.from(t, (x) => (live ? 1.65 + sumAt(outCs, x) : 1.65));
const gh = (fn) => (td.fault ? [{ kind: 'line', t, v: Array.from(t, fn), cls: 'tr ghost' }] : []);
return { T, unit: 'ms', panels: [
{ title: 'In: AM_DET (V)', y: td.fault ? [-0.1, 1.6] : [0.4, 1.6], unit: 'V', refs: [[1, 'DC 1.0 V: to the AGC loop']],
traces: gh((x) => 1 + sumAt(inp, x)).concat([{ kind: 'line', t, v: a, cls: 'tr' }]) },
{ title: 'Out: AMA_OUT (V): DC removed, centred on 1.65 V, trimmed above 5 kHz', y: [1.05, 2.25], unit: 'V', refs: [[1.65, '1.65 V: mid-scale']],
traces: gh((x) => 1.65 + sumAt(scaleBy(inp, sk, 1), x)).concat([{ kind: 'line', t, v: b, cls: 'tr', upto: eC * T }]), sweep: eC > 0 && eC < 1 ? eC * T : null },
], note: '' };
}
// what the waveforms show, in place of the spectrum's caption
function caption(st) {
const td = st.td || {}, names = (st.steps || []).map((x) => x.name);
switch (st.id) {
case 'lim': return !td.carrier ? 'No carrier: Q701 and Q702 amplify the noise until it clips, so it comes out at full level, as random edges. That is the hiss between stations.'
: 'Q701 and Q702 give about 66 dB of gain, so a few millivolts drive LIM2_C all the way from saturation (0.7 V) to cut-off (4.9 V) on every cycle. A weak or strong station comes out the same size: only the timing of the edges, the frequency, is kept. C710 (47 pF) rounds the edges.' +
(td.capt ? ' Here a stronger neighbour has captured the limiter, so these are its edges.' : '');
case 'sq': return 'Q703 turns on whenever LIM2_C rises above about 2.2 V and pulls LIM_SQ to 0 V; off, R715 lifts it to 4.6 V. The result is a clean square wave at the IF, upside down. R716 and R717 divide it to 3.1 V as IF_CNT, whose edges TIM2 counts for the AFC, seek and calibration.';
case 'pump': return !td.carrier ? 'No carrier: the edges come at random, so the packets arrive at random and FM_DEMOD is loud noise that rises with frequency: the hiss.'
: 'Each cycle of LIM_SQ moves the same packet of charge through C714 (22 pF) and D702 into U701A. More cycles per second means more current, so FM_DEMOD = VREF_FM − I · 51 k falls as the frequency rises: frequency has become voltage. R718 ∥ C715 (76.5 µs) averages the packets and also undoes the transmitter’s treble boost, the de-emphasis.';
case 'fmaud': return 'The fine ripple on the audio is the 19 kHz pilot and the stereo signal. U701B’s 15.8 kHz two-pole low-pass takes the stereo signal down about 15 dB but the pilot only 4.5 dB, so a 19 kHz ripple still reaches the ADC; the firmware removes it. C717 and R721 move the audio from FM_DEMOD’s 1.8 V to the ADC’s mid-scale, 1.65 V.';
case 'det': return td.fault ? 'With no IF reaching D601, AM_DET sits near 0 V. The design expects the 455 kHz carrier\u2019s peaks above and, on AM_DET, the audio riding on 1.0 V.' : !td.carrier ? 'No station: no carrier, nothing to detect.'
: 'The IF reaching D601 is a 455 kHz carrier whose peaks rise and fall with the audio. D601 charges C612 to each peak and R619 lets it fall a little before the next (22 µs), so AM_DET follows the peaks: the envelope. Its average is the carrier, the DC the AGC holds at 1.0 V; the audio rides on it.' +
(loudWh(td) ? ' The fast ripple is a neighbour 10 kHz away beating with your carrier: a whistle.' : '');
case 'agc': return td.fault ? 'With nothing on AM_DET, the AGC sits at full gain and AMA_OUT rests at its 1.65 V bias. The design expects the audio on 1.0 V coming in and centred on 1.65 V going out.'
: 'U601A compares AM_DET’s average with V_REF = 1.0 V and sets the AGC amplifiers’ gain, so the carrier always arrives at the same size. C616 passes only the audio, R626 centres it on 1.65 V for the ADC, and U601B’s 4.95 kHz low-pass trims the treble and the 10 kHz whistles.';
case 'dsp': {
const fm = td.band === 'fm';
let t = '';
t += 'PA0 is sampled 192,000 times a second. The 32-tap FIR keeps 0 to 15 kHz, drops everything from 30 kHz, and keeps every 4th sample: 48,000 a second.';
if (fm) t += names.indexOf('19 kHz notch') >= 0 ? ' The notch takes out the 19 kHz ripple.' : ' The pilot notch is off, so a 19 kHz ripple goes to the PC.';
if (names.indexOf('Noise filter') >= 0) t += ' The strong noise filter rounds off the top end.';
t += names.indexOf('Hum canceller') >= 0 ? ' The hum canceller removes the 1 kHz tone the DSP itself makes.' : ' The hum canceller is off, so the 1 kHz tone from the DSP’s own activity is in the audio.';
if (names.indexOf('Gain') >= 0) t += ' The gain scales it; above −4 dBFS the soft limiter rounds the peaks.';
t += names.indexOf('Mute') >= 0 ? ' Muted: the packets carry silence.' : ' Every millisecond 48 samples go to the PC as one USB audio packet.';
return t;
}
}
return '';
}
const loudWh = (td) => (td.wh || []).some((w) => w.rel > -35); // a whistle you could see on the envelope
const STAGE = { lim: S_lim, sq: S_sq, pump: S_pump, fmaud: S_fmaud, dsp: S_dsp, det: S_det, agc: S_agc };
// ------------------------------------------------------------------ drawing
function niceStep(span, n) {
const raw = span / n, p = Math.pow(10, Math.floor(lg(raw)));
for (const m of [1, 2, 2.5, 5]) if (m * p >= raw) return m * p;
return 10 * p;
}
const fmt = (v) => { const a = Math.abs(v); const t = a >= 100 ? v.toFixed(0) : a >= 10 ? v.toFixed(1) : a >= 1 ? v.toFixed(2) : v.toFixed(3); return t.indexOf('.') < 0 ? t : t.replace(/0+$/, '').replace(/\.$/, ''); };
function layout(opt, nPanels, extraH, msg) {
const big = !!(opt && opt.big);
const W = big ? Math.max(440, Math.round(opt.width || 760)) : 600;
const L = big ? 64 : 46, R = W - (big ? 20 : 10);
const ph = big ? Math.round(Math.max(110, Math.min(150, W * 0.18))) : 66;
const gap = big ? 52 : 40, top = big ? (msg ? 66 : 22) : 26;
return { W, L, R, ph, gap, top, big, H: top + nPanels * (ph + gap) + (extraH || 0) + (big ? 6 : 0) };
}
const last = {};
let uid = 0;
function render(stage, idx, opt) {
const fn = STAGE[stage.id];
if (!fn) return '';
const big = !!(opt && opt.big);
const n0 = big ? Math.max(440, Math.round(opt.width || 760)) : 600;
const view = fn(stage, opt || {}, n0);
let panels = view.panels;
if (!big) panels = panels.filter((p) => p.kind !== 'usb' && !/Charge packets/.test(p.title)).slice(0, 2);
const usb = panels.find((p) => p.kind === 'usb');
const plots = panels.filter((p) => p.kind !== 'usb');
const P = progress(stage, opt);
const msg = big ? (P.step ? 'Step ' + (P.k + 1) + ': ' + P.step.title : view.note) : '';
const lay = layout(opt, plots.length, usb ? usb.h + 40 : 0, msg);
const { W, H, L, R, ph, gap, top } = lay;
const T = view.T, us = view.unit === 'µs', tu = us ? 1e6 : 1e3;
const X = (t) => L + t / T * (R - L);
const clip = 'tc' + (++uid);
const o = [];
o.push('<svg class="stg scope' + (big ? ' big' : '') + '" viewBox="0 0 ' + W + ' ' + H + '"' + (big ? ' width="' + W + '" height="' + H + '"' : '') +
' role="img" aria-label="' + esc(stage.title + ': waveforms over time') + '" data-stage="' + esc(stage.id) + '">');
o.push('<defs><clipPath id="' + clip + '"><rect x="' + L + '" y="0" width="' + (R - L) + '" height="' + H + '"/></clipPath></defs>');
// the step being played, or what the window shows
if (msg) {
o.push('<foreignObject x="' + L + '" y="6" width="' + (R - L) + '" height="' + (top - 12) + '"><div xmlns="http://www.w3.org/1999/xhtml" class="strip' + (P.step ? ' stepnow' : '') + '">' + esc(msg) + '</div></foreignObject>');
}
const tStep = niceStep(T * tu, Math.max(4, Math.round((R - L) / (big ? 95 : 80))));
const rows = [];
plots.forEach((p, k) => {
const y0 = top + k * (ph + gap) + (big ? 18 : 14), y1 = y0 + ph;
const Y = (v) => y1 - (Math.max(p.y[0] - (p.y[1] - p.y[0]) * 0.08, Math.min(p.y[1] + (p.y[1] - p.y[0]) * 0.08, v)) - p.y[0]) / (p.y[1] - p.y[0]) * ph;
rows.push({ p, Y, y0, y1 });
const room = R - L - (p.label && big ? p.label.length * 7.9 + 18 : 0); // leave room for the readout on the same line
o.push('<text class="pl" x="' + L + '" y="' + (y0 - (big ? 10 : 7)) + '">' + esc(fitText(p.title, room, big)) + '</text>');
if (!p.noTicks) {
const st = niceStep(p.y[1] - p.y[0], big ? 4 : 2);
for (let j = Math.ceil(p.y[0] / st - 1e-9), v = j * st; v <= p.y[1] + st * 1e-6; j++, v = j * st) {
o.push('<line class="grid" x1="' + L + '" x2="' + R + '" y1="' + Y(v).toFixed(1) + '" y2="' + Y(v).toFixed(1) + '"/><text class="tk" x="' + (L - 7) + '" y="' + (Y(v) + (big ? 4 : 3)).toFixed(1) + '" text-anchor="end">' + fmt(+v.toPrecision(6)) + '</text>');
}
}
o.push('<line class="axis" x1="' + L + '" x2="' + R + '" y1="' + y1 + '" y2="' + y1 + '"/>');
for (let j = 0, tv = 0; tv <= T * tu + 1e-9; j++, tv = j * tStep) {
const x = X(tv / tu), lastT = tv + tStep > T * tu + 1e-9;
o.push('<line class="axis" x1="' + x.toFixed(1) + '" x2="' + x.toFixed(1) + '" y1="' + y1 + '" y2="' + (y1 + 4) + '"/>');
if (k === plots.length - 1 || big) o.push('<text class="tk" x="' + x.toFixed(1) + '" y="' + (y1 + (big ? 17 : 14)) + '" text-anchor="' + (lastT && x > R - 30 ? 'end' : 'middle') + '">' + fmt(+tv.toPrecision(6)) + (lastT ? ' ' + view.unit : '') + '</text>');
}
o.push('<g clip-path="url(#' + clip + ')">');
const refs = (p.refs || []).filter(([v]) => v >= p.y[0] && v <= p.y[1]);
for (const [v, , cls] of refs) o.push('<line class="ref' + (cls ? ' ' + cls : '') + '" x1="' + L + '" x2="' + R + '" y1="' + Y(v).toFixed(1) + '" y2="' + Y(v).toFixed(1) + '"/>');
for (const tr of p.traces || []) o.push(drawTrace(tr, X, Y, y1, T));
for (const [v, label] of refs) if (label) o.push('<text class="refl" x="' + (R - 4) + '" y="' + (Y(v) - 4).toFixed(1) + '" text-anchor="end">' + esc(label) + '</text>');
if (p.sweep != null) o.push('<line class="sweep" x1="' + X(p.sweep).toFixed(1) + '" x2="' + X(p.sweep).toFixed(1) + '" y1="' + y0 + '" y2="' + y1 + '"/>');
o.push('</g>');
if (p.label && big) o.push('<text class="dl rd" x="' + R + '" y="' + (y0 - (big ? 10 : 7)) + '" text-anchor="end">' + esc(p.label) + '</text>');
});
if (usb) {
const y0 = top + plots.length * (ph + gap) + 14, h = usb.h;
o.push('<text class="pl" x="' + L + '" y="' + (y0 - 8) + '">' + esc(usb.title) + '</text>');
const np = usb.packets || 1, pw = (R - L) / np;
for (let k = 0; k < np; k++) {
const x0 = L + k * pw;
o.push('<rect class="pkt" x="' + (x0 + 2).toFixed(1) + '" y="' + y0 + '" width="' + (pw - 4).toFixed(1) + '" height="' + h + '" rx="5"/>');
for (let i = 0; i < 48; i++) { const x = x0 + 6 + (i + 0.5) / 48 * (pw - 12); o.push('<line class="pktt" x1="' + x.toFixed(1) + '" x2="' + x.toFixed(1) + '" y1="' + (y0 + 8) + '" y2="' + (y0 + h - 8) + '"/>'); }
}
}
const yTop = rows.length ? rows[0].y0 : top, yBot = rows.length ? rows[rows.length - 1].y1 : H;
o.push('<line class="xhair" x1="0" x2="0" y1="' + yTop + '" y2="' + yBot + '" visibility="hidden"/>');
o.push('<rect class="hov" x="' + L + '" y="' + (yTop - 6) + '" width="' + (R - L) + '" height="' + (yBot - yTop + 12) + '" data-i="' + idx + '"/>');
o.push('</svg>');
last[stage.id + (big ? ':big' : ':small')] = { view, rows, L, R, T, tu, unit: view.unit, plots };
return o.join('');
}
function fitText(t, w, big) { const n = Math.floor(w / (big ? 7.9 : 6.3)); return t.length > n ? t.slice(0, n - 1) + '…' : t; }
function drawTrace(tr, X, Y, yb, T) {
const upto = tr.upto == null ? T : tr.upto;
if (upto <= 0) return '';
if (tr.kind === 'line') {
const d = [];
for (let i = 0; i < tr.t.length; i++) { if (tr.t[i] > upto + 1e-15) break; d.push((d.length ? 'L' : 'M') + X(tr.t[i]).toFixed(1) + ',' + Y(tr.v[i]).toFixed(1)); }
return d.length ? '<path class="' + tr.cls + '" d="' + d.join('') + '"/>' : '';
}
if (tr.kind === 'band') {
const up = [], dn = [];
for (let i = 0; i < tr.t.length; i++) { const x = X(tr.t[i]).toFixed(1); up.push(x + ',' + Y(tr.hi[i]).toFixed(1)); dn.push(x + ',' + Y(tr.lo[i]).toFixed(1)); }
return '<path class="' + tr.cls + '" d="M' + up.join('L') + 'L' + dn.reverse().join('L') + 'Z"/>';
}
if (tr.kind === 'dots') {
const o = [];
for (let i = 0; i < tr.t.length; i++) { if (tr.t[i] > upto) break; o.push('<circle class="' + tr.cls + '" cx="' + X(tr.t[i]).toFixed(1) + '" cy="' + Y(tr.v[i]).toFixed(1) + '" r="' + (/sm/.test(tr.cls) ? 1.3 : 2.4) + '"/>'); }
return o.join('');
}
if (tr.kind === 'pulses') {
const o = [], w = Math.max(1.5, X(tr.w) - X(0));
for (const t of tr.t) { if (t > upto) break; const x = X(t); o.push('<rect class="' + tr.cls + '" x="' + x.toFixed(1) + '" y="' + Y(tr.h).toFixed(1) + '" width="' + w.toFixed(1) + '" height="' + (yb - Y(tr.h)).toFixed(1) + '"/>'); }
return o.join('');
}
return '';
}
// the hover readout: time, and each panel's value there
function pick(stage, x, opt) {
const L0 = last[stage.id + (opt && opt.big ? ':big' : ':small')];
if (!L0) return null;
const { L, R, T, tu, rows } = L0;
const xc = Math.max(L, Math.min(R, x)), t = (xc - L) / (R - L) * T;
const vals = [];
for (const r of rows) {
const tr = (r.p.traces || []).find((q) => q.kind === 'line' && !/ghost|faint/.test(q.cls)) || (r.p.traces || []).find((q) => q.kind === 'band');
if (!tr || (tr.upto != null && t > tr.upto)) continue;
let i = 0;
while (i < tr.t.length - 1 && tr.t[i + 1] < t) i++;
const v = tr.kind === 'band' ? tr.hi[i] : tr.v[i];
const name = r.p.title.split(':')[0].split(',')[0].split(' (')[0].trim();
vals.push([name, (tr.kind === 'band' ? 'peak ' : '') + fmt(+v.toPrecision(4)) + (r.p.unit ? ' ' + r.p.unit : '')]);
}
return { x: xc, t: t * tu, unit: L0.unit, vals, y1: rows.length ? rows[0].y0 : 0, y2: rows.length ? rows[rows.length - 1].y1 : 0 };
}
return { has, render, pick, caption, IDS };
})();
if (typeof module !== 'undefined') module.exports = SCOPE;
// The math of each block as one derivation: an input equation, the operations the parts perform (each naming the
// parts and the domain it is worked in), and the output equation. Engineer's math: terms that end up near zero are
// struck out and dropped, and the numbers come from the parts (tools/design.py) and the station in the tuner.
//
// Markup: {f_LO} is an italic variable with a subscript ({ω_0}, {V_T}); [[num || den]] is a stacked fraction; ^(…) or ^−0.7 is a superscript;
// ~~ … ~~ is a term that is dropped because it is (nearly) zero. Unicode does the rest: ² ³ ⁻¹ √ ∫ Σ ∥ ≈ ω π τ.
// Equations joined by ', ' (comma, three spaces) go on separate lines.
var MATH = (function () {
const RS = (typeof SPECTRUM !== 'undefined' && SPECTRUM.resp) || null;
const PI2 = 2 * Math.PI;
const lg = Math.log10;
const n = (x, d) => (+x.toFixed(d == null ? 3 : d)).toString();
const SUP = { '-': '⁻', 0: '⁰', 1: '¹', 2: '²', 3: '³', 4: '⁴', 5: '⁵', 6: '⁶', 7: '⁷', 8: '⁸', 9: '⁹' };
// a gain as a plain number: 0.75, 0.018, 3×10⁻⁶
const num = (x) => {
if (x === 0) return '0';
const e = Math.floor(lg(Math.abs(x)));
if (e >= -2 && e < 4) return String(+x.toPrecision(2));
return +(x / Math.pow(10, e)).toFixed(1) + '×10' + String(e).split('').map((c) => SUP[c]).join('');
};
const g = (db) => Math.pow(10, db / 20); // dB to an amplitude ratio
const dbs = (db) => (db >= 0 ? '+' : '−') + Math.abs(db).toFixed(Math.abs(db) < 10 ? 1 : 0) + ' dB';
const mhz = (f) => n(f, 3) + ' MHz';
const ser = (a, b) => (a * b) / (a + b);
const cv = (v) => 56 * Math.pow(1 + v / 0.7, -0.678); // BB910 varactor, pF
const fres = (L, CpF) => 1 / (PI2 * Math.sqrt(L * CpF * 1e-12)) / 1e6;
const rcg = (f, fc) => 1 / Math.sqrt(1 + Math.pow(f / fc, 2));
const skg = (f, f0, Q) => { const x = f / f0; return 1 / Math.sqrt(Math.pow(1 - x * x, 2) + Math.pow(x / Q, 2)); };
const resp = (name, f, fallback) => (RS && RS[name] ? RS[name](f) : fallback);
const IN = (eq, note) => ({ k: 'in', eq, note });
const OP = (op, by, dom, eq, note) => ({ k: 'op', op, by, dom, eq, note });
const OUT = (eq, note) => ({ k: 'out', eq, note });
const unreachable = (what) => ({ chain: [IN(what, ''), OUT('No LO setting reaches this station on the first board', 'Pick a station inside the board’s range in the tuner.')] });
return {
ant: (c) => {
if (c.band !== 'am') {
const fs = c.ffm, hs = resp('fmLeg', fs, -2.5), ho = resp('fmLeg', 1.01, -110);
return {
chain: [
IN('{v_ant}(t) = A cos({ω_s}t) + B cos({ω_m}t)', 'Your station at ' + n(fs, 1) + ' MHz ({ω_s} = 2π · ' + n(fs, 1) + ' MHz) and a medium-wave station at 1.01 MHz. Every other signal goes through the same way.'),
OP('Write each part in the s-domain', 'L and C', 's', '{Z_L}(s) = sL, {Z_C}(s) = [[1 || sC]]', 'A capacitor gets easier to pass at high frequency, an inductor at low frequency.'),
OP('Solve the FM leg’s ladder', 'C303, L304, C304 · C305, L305, C306', 's',
'{H}(s) = [[s³ || s³ + 2{ω_h}s² + 2{ω_h}²s + {ω_h}³]] · [[{ω_l}³ || s³ + 2{ω_l}s² + 2{ω_l}²s + {ω_l}³]]',
'A 3rd-order high-pass at 70 MHz times a 3rd-order low-pass at 130 MHz ({ω_h} = 2π · 70 MHz, {ω_l} = 2π · 130 MHz).'),
OP('Put in s = jω for each signal', '', 'jw', '|{H}(j{ω_s})| = ' + num(g(hs)) + ' (' + dbs(hs) + '), |{H}(j{ω_m})| = ' + num(g(ho)) + ' (' + dbs(ho) + ') ≈ 0',
'From the six actual L/C values with 50 Ω at each end.'),
],
out: OUT('{v_FM}(t) ≈ ' + num(g(hs)) + 'A cos({ω_s}t + φ) ~~+ ' + num(g(ho)) + 'B cos({ω_m}t)~~', 'Medium wave is gone. φ is the ladder’s phase shift, which FM does not care about.'),
how: 'Each leg is a ladder of the two component laws. In the FM leg, C303 and C304 are series capacitors and L304 shunts to ground: at FM, 1/(sC) is small and sL is large, so the signal passes; at medium wave the opposite holds and it is blocked. The 22 pF / 120 nH / 22 pF section is the mirror image, removing everything above 130 MHz. Because each leg starts with the element that blocks the other band, the two can share one antenna node.',
flow: '{Z_C} = [[1 || sC]]',
};
}
const fs = c.fam / 1000, hs = resp('amLeg', fs, -0.1), ho = resp('amLeg', c.ffm, -110);
return {
chain: [
IN('{v_ant}(t) = A cos({ω_s}t) + B cos({ω_f}t)', 'Your station at ' + c.fam + ' kHz ({ω_s} = 2π · ' + c.fam + ' kHz) and an FM station at ' + n(c.ffm, 1) + ' MHz.'),
OP('Write each part in the s-domain', 'L and C', 's', '{Z_L}(s) = sL, {Z_C}(s) = [[1 || sC]]', 'Series inductors pass low frequencies; shunt capacitors short high frequencies to ground.'),
OP('Solve the AM leg’s ladder', 'L301, C301, L302, C302, L303', 's', '{H}(s) = [[{ω_c}⁵ || s⁵ + 3.24{ω_c}s⁴ + 5.24{ω_c}²s³ + 5.24{ω_c}³s² + 3.24{ω_c}⁴s + {ω_c}⁵]]',
'A 5-pole Butterworth low-pass, {ω_c} = 2π · 2 MHz.'),
OP('Put in s = jω for each signal', '', 'jw', '|{H}(j{ω_s})| = ' + num(g(hs)) + ' (' + dbs(hs) + '), |{H}(j{ω_f})| = ' + num(g(ho)) + ' (' + dbs(ho) + ') ≈ 0',
'From the five actual L/C values with 50 Ω at each end.'),
],
out: OUT('{v_AM}(t) ≈ ' + num(g(hs)) + 'A cos({ω_s}t + φ) ~~+ ' + num(g(ho)) + 'B cos({ω_f}t)~~', 'FM and everything above 2 MHz is gone; the whole medium-wave band passes.'),
how: 'The AM leg alternates series inductors (L301, L302, L303) and shunt capacitors (C301, C302): a 5-pole low-pass. Its first element is a series inductor, which is a high impedance at FM, so it does not load the FM leg on the shared antenna node.',
flow: '{Z_L} = sL',
};
},
fmrf: (c) => {
const K = c.fmK, f = c.ffm, f0 = K.tank, Q = 10;
const x = f / f0 - f0 / f, k = 1 / Math.sqrt(1 + Q * Q * x * x);
const gm = 1 / (6.5 + 22), Rp = 900, Av = gm * Rp * k, G = Av * 0.2;
const on = Math.abs(f0 - f) < 0.05;
return {
chain: [
IN('{v_b}(t) = A cos({ω_s}t)', 'Your station at ' + n(f, 1) + ' MHz, out of the diplexer.'),
OP('Turn the voltage into a current', 'Q301, R305', 't', '{i_c}(t) = −{g_m}{v_b}(t), {g_m} = [[1 || {r_e} + {R_E}]] = [[1 || 6.5 Ω + 22 Ω]] = 35 mS',
'{r_e} = 26 mV / 4 mA. The unbypassed 22 Ω (R305) keeps {g_m} steady and linear.'),
OP('Push it into the tank', 'L306, C309, C310, D301', 's', '{Z}(s) = [[s / C || s² + s / ({R_p}C) + 1 / (LC)]]',
'A parallel RLC: L306 is L, C309 plus C310 in series with the varactor is C, and {R_p} ≈ 900 Ω is the losses and the mixer’s load (estimate).'),
OP('Evaluate at the station', 'VT_RF = ' + n(K.vtRf, 2) + ' V', 'jw', '|{Z}(j{ω_s})| = [[{R_p} || √(1 + Q²(f/{f_0} − {f_0}/f)²)]] = 900 Ω × ' + n(k, 2) + ' = ' + n(Rp * k, 0) + ' Ω',
(on ? 'The tank is tuned onto the station ({f_0} = ' + n(f0, 2) + ' MHz), so the bracket is 0 and |Z| = {R_p}.' : 'The tank sits at {f_0} = ' + n(f0, 2) + ' MHz, ' + n(Math.abs(f0 - f), 2) + ' MHz off the station, which costs ' + dbs(20 * lg(k)) + '.') + ' Q = 10.'),
OP('Collector voltage', 'Q301', 't', '{v_c} = −{g_m}|{Z}|{v_b} = −35 mS × ' + n(Rp * k, 0) + ' Ω × A = −' + n(Av, 1) + 'A'),
OP('Tap off to the mixer', 'C313 (4.7 pF)', 't', '{v_mix} ≈ 0.2 · {v_c}', 'A small tap so the mixer does not load the tank; about a fifth gets through (estimate).'),
],
out: OUT('{v_mix}(t) ≈ −' + n(G, 1) + 'A cos({ω_s}t)', 'About ' + dbs(20 * lg(G)) + ' (estimate). Stations far from {f_0} get less: that is the tank’s selectivity.'),
how: 'Q301 is the transconductor: its collector current follows the base voltage. That current flows into the tank, whose impedance peaks at ω₀ = 1/√(LC), so only signals near the station see gain. VT_RF reverse-biases D301 through R307 and moves C, which moves ω₀.',
flow: '{ω_0} = [[1 || √(LC)]]',
};
},
fmlo: (c) => {
const K = c.fmK, P = K.P;
if (P.lo == null) return unreachable('{f_LO} = ' + n(c.ffm, 1) + ' ± 10.695 MHz');
const below = P.side === 'below', lo = P.lo;
const head = IN('{V_DAC} = [[' + K.dac + ' || 4095]] × 3.3 V = ' + n(K.vdac, 3) + ' V',
c.fmK.c.tune === 'dac' ? 'The DAC code you set (AFC off).' : 'The code the firmware picks for ' + n(c.ffm, 1) + ' MHz' + (below ? ' (from below, as on the first board)' : '') + '.');
const amp = OP('Scale up to the tuning voltage', 'U201, R201, R202', 't', '{V_T} = (1 + [[10 kΩ || 22 kΩ]]) {V_DAC} = 1.45 × ' + n(K.vdac, 3) + ' V = ' + n(K.vt, 3) + ' V', 'The two RC poles after it (3.4 Hz and 16 Hz) only remove noise.');
const loop = OP('Loop gain of exactly 1 at 0°', 'Q302, C318, C317', 's', '{T}(j{ω_LO}) = {g_m}{Z_tank}β = 1, β = [[{C_318} || {C_318} + {C_317}]] = [[4.7 pF || 19.7 pF]] = 0.24',
'Above 1 the swing grows out of noise until Q302 saturates, which pins the loop gain at 1.');
const out = OUT('{v_LO}(t) = B cos(2π · ' + mhz(lo) + ' · t)', (below ? 'f_RF − f_LO' : 'f_LO − f_RF') + ' = ' + n(Math.abs(lo - c.ffm), 3) + ' MHz: the IF.');
if (c.mode === 'board') {
return { chain: [head, amp, OP('Look up the first board’s calibration', 'measured table', 't', '{f_LO} = table(' + K.dac + ') = ' + mhz(lo), 'The first board’s LO runs low (91.5 to 99.2 MHz) because of extra capacitance, so the firmware uses measured code-to-frequency tables.'), loop], out,
how: 'Q302 runs common-base with the C318/C317 divider feeding part of the collector swing back to the emitter. L307 with C319 and the varactor D302 (through C320) is the tank; VT_FM changes D302’s capacitance, which is how the DAC tunes the radio.', flow: '{ω_LO} = [[1 || √(L{C_T})]]' };
}
const cvv = cv(K.vt), cs = ser(22, cvv), ct = 7.84 + cs;
return {
chain: [head, amp,
OP('Set the varactor', 'D302 (BB910)', 't', '{C_v} = 56 pF · (1 + {V_T} / 0.7 V)^−0.678 = ' + n(cvv, 1) + ' pF', 'More reverse voltage, less capacitance.'),
OP('Add up the tank capacitance', 'C319, C320, C318/C317', 't', '{C_T} = 7.8 pF + [[{C_320} {C_v} || {C_320} + {C_v}]] = 7.8 + ' + n(cs, 1) + ' = ' + n(ct, 1) + ' pF',
'7.8 pF = C319 (3.3 pF) + the C318/C317 divider (3.6 pF) + Q302 (≈ 1 pF). C320 (22 pF) in series narrows the varactor’s swing.'),
OP('Find the resonance', 'L307 (110 nH)', 's', '{Z_tank}(s) has poles at s = ±j{ω_LO}, {f_LO} = [[1 || 2π√(L{C_T})]] ≈ ' + n(fres(110e-9, ct), 1) + ' MHz',
'At ±j{ω_LO} the tank’s reactances cancel.'),
loop],
out,
how: 'Q302 runs common-base: C316 grounds its base for RF, so the emitter is the input and the collector the output. C318 and C317 are a capacitive divider that feeds part of the output back in phase: that is β. L307 with C319 and the varactor D302 (through C320) is the tank; VT_FM changes D302’s capacitance, which is how the DAC tunes the radio.',
flow: '{ω_LO} = [[1 || √(L{C_T})]]',
};
},
fmmix: (c) => {
const K = c.fmK, P = K.P, f = c.ffm;
if (P.lo == null) return unreachable('{v_RF}(t) = A cos(2π · ' + n(f, 1) + ' MHz · t)');
const lo = P.lo, below = P.side === 'below', d = Math.abs(lo - f), s = lo + f;
const dW = below ? '({ω_s} − {ω_LO})' : '({ω_LO} − {ω_s})';
const off = Math.abs(d - 10.695) > 0.002;
return {
chain: [
IN('{v_RF}(t) = A cos({ω_s}t), {v_LO}(t) = B cos({ω_LO}t)', 'Your station at ' + n(f, 1) + ' MHz from the RF amplifier, and the LO at ' + mhz(lo) + ' from Q302.'),
OP('Add them on the base', 'C313, C321', 't', '{v_be}(t) = {v_RF}(t) + {v_LO}(t)', 'C313 brings the RF and C321 the LO onto Q303’s base; C322 grounds the emitter at RF.'),
OP('The junction is exponential: expand it', 'Q303', 't', '{i_c} = {I_S} e^({v_be}/{V_T}) ≈ {I_C} [1 + [[{v_be} || {V_T}]] + [[{v_be}² || 2{V_T}²]] ~~+ [[{v_be}³ || 6{V_T}³]] + …~~]',
'For small signals the cube and higher terms are tiny: drop them.'),
OP('Square the sum; keep the cross term', '', 't', '{v_be}² = ~~A² cos²({ω_s}t)~~ + 2AB cos({ω_s}t) cos({ω_LO}t) ~~+ B² cos²({ω_LO}t)~~',
'The squares land at 0 Hz and twice each frequency, nowhere near 10.7 MHz: drop them. Only the cross term multiplies RF by LO.'),
OP('Product to sum', '', 't', '2 cos a cos b = cos(a − b) + cos(a + b), so 2AB cos({ω_s}t) cos({ω_LO}t) = AB cos(' + dW + 't) + AB cos(({ω_LO} + {ω_s})t)'),
OP('The same step in the s-domain', '', 's', '{V}(s) → ½ [ {V}(s − j{ω_LO}) + {V}(s + j{ω_LO}) ]', 'Multiplying by a cosine shifts the whole spectrum by ±{f_LO}: a copy down and a copy up, as in the chart above.'),
OP('Put in the numbers', '', 't', '= AB cos(2π · ' + mhz(d) + ' · t) + AB cos(2π · ' + mhz(s) + ' · t)'),
OP('Keep only what the 10.7 MHz filter passes', 'R501, FL501', 'jw', '|{H}(j2π · ' + n(s, 1) + ' MHz)| ≈ 0 → ~~AB cos(2π · ' + n(s, 1) + ' MHz · t)~~',
'R501 turns the collector current into a voltage; the ceramic filter that follows passes only around 10.7 MHz.'),
],
out: OUT('{v_IF}(t) ≈ K · AB cos(2π · ' + mhz(d) + ' · t), K = [[{I_C}{R_501} || 2{V_T}²]]',
off ? 'Your station comes out ' + n(Math.abs(d - 10.695) * 1000, 0) + ' kHz from the 10.695 MHz centre (manual DAC, AFC off): the filters will cut it.' : 'Your station, now at the 10.695 MHz IF' + (below ? '.' : ', mirrored: LO − f flips the order of the stations.')),
how: 'A transistor’s collector current is exponential in its base voltage, and the square term of that exponential contains 2·v_RF·v_LO: the product the mixer needs. Everything except the difference near 10.7 MHz is thrown away by the ceramic filter that follows.',
flow: '{f_IF} = {f_LO} − {f_RF}',
};
},
amrf: (c) => {
const tau = 100e-9 * 1e3, w = PI2 * c.fam * 1e3, hc = (w * tau) / Math.sqrt(1 + Math.pow(w * tau, 2));
return {
chain: [
IN('{v_i}(t) = A cos({ω_s}t)', 'Your station at ' + c.fam + ' kHz, out of the AM leg.'),
OP('Coupling capacitor', 'C401', 's', '{H_c}(s) = [[sτ || 1 + sτ]], τ ≈ 100 nF × 1 kΩ = 0.1 ms', 'A high-pass with its corner at 1.6 kHz, far below medium wave.'),
OP('Evaluate at the station', '', 'jw', '|{H_c}(j{ω_s})| = [[{ω_s}τ || √(1 + ({ω_s}τ)²)]] = ' + n(hc, 6) + ' ≈ 1'),
OP('Common-emitter gain', 'Q401, R407, R405', 't', '{A_v} = −[[{R_C} || {r_e} + {R_E}]] = −[[470 Ω || 6.8 Ω + 22 Ω]] = −16',
'{r_e} = 26 mV / 3.8 mA = 6.8 Ω. R406 is bypassed by C404, so it only sets the DC current.'),
],
out: OUT('{v_o}(t) ≈ −16A cos({ω_s}t)', 'About +24 dB, flat across the AM band: nothing here is tuned.'),
how: 'R407 is the collector load R_C and the unbypassed R405 (22 Ω) is R_E. C401 blocks DC and passes everything from about 2 kHz up, so the whole AM band gets the same gain.',
flow: '{A_v} = [[{R_C} || {r_e} + {R_E}]]',
};
},
amlo: (c) => {
const K = c.amK, P = K.P, sum = P.side === 'sum', f = c.fam / 1000;
if (P.lo == null) return unreachable('{f_LO} = 10.695 ± ' + n(f, 3) + ' MHz');
const lo = P.lo, Cs = 1 / Math.pow(PI2 * lo * 1e6, 2) / 8.2e-6 * 1e12;
const Cb = 1 / (1 / Cs - 1 / 220 - 1 / 470), Cx = Cb - 15;
const Cv = Cx > 0 && Cx < 33 ? 1 / (1 / Cx - 1 / 33) : null;
const fit = Cv == null ? 'more than C411 can pass even with an infinite varactor' : Cv > 56 ? 'more than the BB910 gives at 0 V (56 pF): the first board gets there only through its extra stray capacitance'
: Cv < 13.9 ? 'less than the BB910 reaches at 4.8 V (13.9 pF): with these values the top of the band is out of reach' : 'inside the BB910’s 13.9 to 56 pF range (4.8 V to 0 V)';
return {
chain: [
IN('{f_LO} = ' + (sum ? '{f_IF} − {f_RF} = 10.695 − ' + n(f, 3) : '{f_RF} + {f_IF} = ' + n(f, 3) + ' + 10.695') + ' = ' + mhz(lo),
sum ? 'The first board’s AM LO runs low, so the firmware uses the mixer’s sum product.' : 'AM is converted up: the LO runs 10.695 MHz above the station.'),
OP('What series capacitance resonates there', 'L401 (8.2 µH)', 's', '{Z_series}(s) = sL + [[1 || s{C_s}]] = 0 at s = j{ω_LO}, {C_s} = [[1 || (2π{f_LO})² L]] = ' + n(Cs, 1) + ' pF',
'In a Clapp oscillator the series L-C branch is a short at the oscillation frequency.'),
OP('Take out the feedback divider', 'C408, C409', 't', '[[1 || {C_s}]] = [[1 || {C_tune}]] + [[1 || 220 pF]] + [[1 || 470 pF]], {C_tune} = ' + n(Cb, 1) + ' pF',
'C408 and C409 are large, so they barely count: that is why Q402’s own capacitance hardly moves the frequency.'),
OP('What the varactor must be', 'C410, C411, D401', 't', '{C_tune} = 15 pF + [[33 pF · {C_v} || 33 pF + {C_v}]], {C_v} = ' + (Cv == null ? '-' : n(Cv, 1) + ' pF'),
'That is ' + fit + '. VT_AM from the DAC sets D401.'),
OP('Loop gain of exactly 1 at 0°', 'Q402, C408, C409', 's', '{T}(j{ω_LO}) = {g_m}{Z}β = 1', 'C408 and C409 feed part of the emitter swing back; Q402’s nonlinearity settles the amplitude.'),
],
out: OUT('{v_LO}(t) = B cos(2π · ' + mhz(lo) + ' · t)', 'Taken at the emitter and coupled to the mixer through C412.'),
how: 'This is a Clapp oscillator: L401 is in series with the small tuning capacitance (C410 in parallel with C411 and the varactor D401), and C408/C409 form the feedback divider. Because the series capacitance is far smaller than C408 and C409, it sets the frequency almost alone.',
flow: '{ω_LO} = [[1 || √(L{C_s})]]',
};
},
ammix: (c) => {
const K = c.amK, P = K.P, f = c.fam / 1000;
if (P.lo == null) return unreachable('{v_RF}(t) = A cos(2π · ' + c.fam + ' kHz · t)');
const lo = P.lo, sum = P.side === 'sum', d = Math.abs(lo - f), s = lo + f;
const keep = sum ? s : d, drop = sum ? d : s;
return {
chain: [
IN('{v_RF}(t) = A cos({ω_s}t), {v_LO}(t) = B cos({ω_LO}t)', 'Your station at ' + c.fam + ' kHz from the preamp, and the LO at ' + mhz(lo) + ' from Q402.'),
OP('Add them on the base; the junction squares the sum', 'C405, C412, Q403', 't', '{i_c} ≈ {I_C}[1 + [[{v_be} || {V_T}]] + [[{v_be}² || 2{V_T}²]]], {v_be}² ⊃ 2AB cos({ω_s}t) cos({ω_LO}t)',
'The same exponential-junction multiplier as the FM mixer; the squared terms of each input land far from 10.7 MHz and are dropped.'),
OP('Product to sum', '', 't', '2AB cos({ω_s}t) cos({ω_LO}t) = AB cos(({ω_LO} − {ω_s})t) + AB cos(({ω_LO} + {ω_s})t)'),
OP('Put in the numbers', '', 't', '= AB cos(2π · ' + mhz(d) + ' · t) + AB cos(2π · ' + mhz(s) + ' · t)'),
OP('Keep only what the 10.7 MHz filter passes', 'R501, FL501', 'jw', '|{H}(j2π · ' + n(drop, 3) + ' MHz)| ≈ 0 → ~~AB cos(2π · ' + n(drop, 3) + ' MHz · t)~~',
sum ? 'Here the difference is the one thrown away: the first board keeps the sum.' : 'The sum at ' + n(s, 3) + ' MHz is far outside the filter.'),
],
out: OUT('{v_IF}(t) ≈ K · AB cos(2π · ' + mhz(keep) + ' · t)', 'Your station on the 10.695 MHz IF.'),
how: 'C405 brings the preamplified RF and C412 the LO to Q403’s base, C413 grounds the emitter, and the collector shares R501 with the FM mixer. Only one front end is powered at a time, so the two mixers never fight over that node.',
flow: '{f_IF} = {f_LO} − {f_RF}',
};
},
cf1: (c) => {
const fm = c.band !== 'am', dn = fm ? 0.4 : 0.1;
const h0 = resp('cer10', 10.695, -4), hn = resp('cer10', 10.695 + dn, -35);
return {
chain: [
IN('{v_i}(t) = A cos({ω_IF}t) + B cos({ω_n}t)', 'Your station at 10.695 MHz and a neighbour ' + (fm ? '400' : '100') + ' kHz away, as the mixer left them.'),
OP('Each resonator is a band-pass', 'FL501', 's', '{H}(s) ≈ [[({ω_0}/Q) s || s² + ({ω_0}/Q) s + {ω_0}²]], Q = [[{f_0} || BW]] = [[10.7 MHz || 180 kHz]] ≈ 59',
'The ceramic plate only vibrates strongly near 10.7 MHz. Its real shape is the datasheet’s: 180 kHz wide at −3 dB, 4 dB loss.'),
OP('Put in s = jω for each signal', 'R501, R503 (330 Ω)', 'jw', '|{H}(j{ω_IF})| = ' + num(g(h0)) + ' (' + dbs(h0) + '), |{H}(j{ω_n})| = ' + num(g(hn)) + ' (' + dbs(hn) + ')',
'The filter only has this shape with 330 Ω on both sides.'),
],
out: OUT('{v_o}(t) ≈ ' + num(g(h0)) + 'A cos({ω_IF}t + φ) + ' + num(g(hn)) + 'B cos({ω_n}t)',
fm ? 'FM’s ±75 kHz deviation fits in 180 kHz (Carson: 2 × (75 + 15) kHz). The neighbour is down but not gone: the second filter finishes it.' : 'For AM this filter is far too wide: the 455 kHz filter does the real channel selection.'),
how: 'FL501 is a piezoelectric ceramic plate: the electrodes turn voltage into vibration and back, and the plate only rings near its mechanical resonance at 10.7 MHz. R501 (the mixer’s load) and R503 are the 330 Ω source and load it is designed for. C502 shunts the 100 MHz LO leakage before the filter.',
flow: 'BW = 2(Δf + {f_m})',
};
},
ifamp: (c) => {
const fm = c.band !== 'am', dn = fm ? 0.4 : 0.1;
const h0 = g(resp('cer10', 10.695, -4)), hn = g(resp('cer10', 10.695 + dn, -35));
const Av = 165 / (6.7 + 22), a = Av * h0 * h0, b = Av * hn * hn;
return {
chain: [
IN('{v_i}(t) = A cos({ω_IF}t) + B cos({ω_n}t)', 'Your station and the same neighbour, as they leave FL501 (A and B include its gain).'),
OP('Common-emitter gain', 'Q501, R508, R506', 't', '{A_v} = −[[{R_C} ∥ {R_L} || {r_e} + {R_E}]] = −[[330 Ω ∥ 330 Ω || 6.7 Ω + 22 Ω]] = −' + n(Av, 1),
'R508 is {R_C}; the second filter’s 330 Ω input is {R_L}; the unbypassed R506 is {R_E}.'),
OP('The second filter, same shape', 'FL502', 'jw', '|{H}(j{ω_IF})| = ' + num(h0) + ', |{H}(j{ω_n})| = ' + num(hn)),
OP('Multiply it through', '', 't', '{v_o} = −' + n(Av, 1) + ' × [' + num(h0) + 'A cos({ω_IF}t) + ' + num(hn) + 'B cos({ω_n}t)]'),
],
out: OUT('{v_o}(t) ≈ −' + n(Av * h0, 1) + 'A cos({ω_IF}t) ~~− ' + num(Av * hn) + 'B cos({ω_n}t)~~',
'From the mixer to here the neighbour has been multiplied by ' + num(b) + ' against ' + n(a, 1) + ' for your station: about ' + n(20 * lg(a / b), 0) + ' dB apart, so call it zero.'),
how: 'Q501 is a common-emitter stage whose gain only makes up for the two filters’ losses, so the 10.7 MHz strip stays well below the level where it would distort. Two filters in a row double the skirt in dB.',
flow: '{A_v} = [[{R_C} ∥ {R_L} || {r_e} + {R_E}]]',
};
},
mix2: (c) => {
const h1 = rcg(0.455, 1.06), h2 = rcg(20.935, 1.06);
return {
chain: [
IN('{v_IF1}(t) = A cos(2π · 10.695 MHz · t), {v_XO}(t) = B cos(2π · 10.240 MHz · t)', 'Your station on the first IF, and the crystal oscillator.'),
OP('Multiply (the same junction trick as the first mixer)', 'C508, C509, Q502', 't', '{v}(t) ∝ AB cos(2π · 10.695 MHz · t) cos(2π · 10.240 MHz · t)',
'C508 brings the IF and C509 the crystal onto Q502’s base; C510 grounds the emitter.'),
OP('Product to sum', '', 't', '= [[AB || 2]] [cos(2π · 0.455 MHz · t) + cos(2π · 20.935 MHz · t)]'),
OP('The collector load is a low-pass', 'R513, C511', 's', '{H}(s) = [[{R_513} || 1 + s{R_513}{C_511}]], {f_c} = [[1 || 2π · 1.5 kΩ · 100 pF]] = 1.06 MHz'),
OP('Put in s = jω for both terms', '', 'jw', '|{H}(j2π · 0.455 MHz)| = ' + n(h1, 2) + '{R_513}, |{H}(j2π · 20.9 MHz)| = ' + n(h2, 3) + '{R_513} ≈ 0'),
],
out: OUT('{v_IF2}(t) ≈ K · AB cos(2π · 455 kHz · t) ~~+ ' + n(h2 / h1, 2) + 'K · AB cos(2π · 20.9 MHz · t)~~', 'The 455 kHz IF. It feeds both the FM limiter and the AM filter.'),
how: 'Q502 multiplies exactly like the first mixers. Its collector load, R513 with C511, is a low-pass that keeps the 455 kHz difference and sinks the 10 and 20 MHz products.',
flow: '{f_IF2} = {f_IF1} − {f_XO}',
};
},
xo: () => ({
chain: [
IN('{Z_xtal}(s) = ({R_m} + s{L_m} + [[1 || s{C_m}]]) ∥ [[1 || s{C_0}]]', 'The quartz crystal’s electrical model (Butterworth-Van Dyke): a series RLC from its mechanics, shunted by its electrode capacitance.'),
OP('Series resonance: the reactances cancel', 'Y501', 's', 's{L_m} + [[1 || s{C_m}]] = 0 at {ω_s} = [[1 || √({L_m}{C_m})]]', 'The Q is enormous (tens of thousands), so the loop only has gain in a few-hertz window.'),
OP('The load capacitance pulls it to 10.240 MHz', 'C514, C515, C516', 't', '[[1 || {C_L}]] = [[1 || 100 pF]] + [[1 || 220 pF]] + [[1 || 15 pF]], {C_L} = 12.3 pF',
'The crystal was cut for a 12 pF load; C516 completes it.'),
OP('Loop gain of 1 only at the crystal’s frequency', 'Q503 (Colpitts)', 's', '{T}(j{ω_XO}) = 1, |{T}(jω)| < 1 elsewhere', 'C514 and C515 are the Colpitts feedback divider.'),
],
out: OUT('{v_XO}(t) = B cos(2π · 10.240 MHz · t)', '± 20 ppm, which is ± 205 Hz.'),
how: 'Q503 is a Colpitts amplifier with C514 and C515 as the feedback divider; the crystal sits in the base circuit, so the loop only has gain at the crystal’s resonance. C516 completes the 12 pF load the crystal was cut for.',
flow: '{ω_s} = [[1 || √({L_m}{C_m})]]',
}),
lim: () => {
const h1 = rcg(0.455, 0.482), h2 = rcg(10, 0.482);
return {
chain: [
IN('{v_in}(t) = A(t) cos θ(t), θ(t) = 2π · 455 kHz · t + 2π · 75 kHz ∫ m(τ) dτ', 'FM keeps the audio m(t) in the phase θ. The amplitude A(t) only carries fading and noise.'),
OP('RC low-pass first (time domain)', 'R702, C704', 't', 'RC [[d{v} || dt]] + {v}(t) = {v_in}(t)'),
OP('Laplace transform it', '', 's', '(1 + sRC) {V}(s) = {V_in}(s), {H}(s) = [[1 || 1 + sRC]], {f_c} = [[1 || 2π · 2.2 kΩ · 150 pF]] = 482 kHz'),
OP('Put in s = jω', '', 'jw', '|{H}(j2π · 455 kHz)| = ' + n(h1, 2) + ', |{H}(j2π · 10 MHz)| = ' + n(h2, 3) + ' ≈ 0', 'The last 10 MHz products from the second mixer are dropped.'),
OP('66 dB of gain, then the rails', 'Q701, Q702', 't', '{v_out}(t) = {V_sat} · sgn(cos θ(t))', 'Two common-emitter stages of about 33 dB each: anything above a few millivolts is clipped flat. A(t) is gone.'),
OP('A square wave’s Fourier series', '', 'f', 'sgn(cos θ) = [[4 || π]] [cos θ − [[1 || 3]] cos 3θ + [[1 || 5]] cos 5θ − …]'),
],
out: OUT('{v_out}(t) = [[4{V_sat} || π]] [cos θ(t) − [[1 || 3]] cos 3θ(t) + …]', 'Constant amplitude: only θ(t), and with it the frequency, survives. The harmonics at 1.365 and 2.275 MHz do not matter, because the next stages only use the zero crossings.'),
how: 'R702 and C704 are the RC low-pass. Q701 and Q702 are plain common-emitter stages (2.2 kΩ loads, emitters bypassed) with so much gain that the collectors swing between cut-off and saturation. That is the sgn() function.',
flow: '{v_out} = {V_sat} sgn({v_in})',
};
},
rssi: () => ({
chain: [
IN('{v}(t) = A(t) cos({ω_IF}t)', 'The first limiter stage’s collector, LIM1_C.'),
OP('Conduct only on the positive peaks', 'C711, R711, D701', 't', '{i_D}(t) > 0 only when {v}(t) > {v_C} + {V_f}', 'C711 and R711 re-centre the swing; the diode tops up C712 near each peak.'),
OP('Charge on the peaks, bleed in between', 'C712, R712', 't', '{C} [[d{v_C} || dt]] = {i_D}(t) − [[{v_C} || R]]'),
OP('Between peaks it is a one-pole low-pass', '', 's', '{H}(s) = [[1 || 1 + sτ]], τ = 100 kΩ × 100 nF = 10 ms', 'At 455 kHz the ripple is ≈ 0; the voltage follows A(t) with a 10 ms memory.'),
],
out: OUT('{V_RSSI}(t) ≈ A(t) − {V_f}', 'On the first board stage 1 already clips on noise, so A is almost constant and the firmware does not use this.'),
how: 'D701 conducts only on the positive peaks of LIM1_C (through C711, with R711 restoring the DC level), topping up C712; R712 bleeds it down between peaks.',
flow: 'τ = RC = 10 ms',
}),
sq: () => ({
chain: [
IN('{v_in}(t) = [[4{V_sat} || π]] cos θ(t) + …', 'The limiter output, LIM2_C: already nearly square.'),
OP('Divider with a speed-up capacitor', 'R713, R714, C713', 's', '{H}(s) = [[{R_714} || {R_713} + {R_714}]] · [[1 + s{R_713}{C_713} || 1 + s({R_713} ∥ {R_714}){C_713}]]',
'0.32 at DC but 1 for fast edges: C713 passes the edges straight to the base so the switching is crisp.'),
OP('Switch', 'Q703, R715', 't', '{v_out}(t) = 4.6 V if {v_in}(t) > {V_th} ≈ 2.2 V, otherwise 0', '{V_th} ≈ 0.65 V × (10 + 4.7) / 4.7.'),
OP('A 50 % square wave’s series', '', 'f', '{v_out}(t) = 2.3 V + [[4 · 2.3 V || π]] [sin θ + [[1 || 3]] sin 3θ + …]'),
OP('Scale for the MCU', 'R716, R717', 't', 'IF_CNT = 4.6 V × [[10 kΩ || 14.7 kΩ]] = 3.1 V', 'A valid logic high for the STM32’s counter input.'),
],
out: OUT('LIM_SQ(t) = a 0 to 4.6 V square wave at {f_IF}(t)', 'Its edges carry the frequency: the charge pump counts them, and so does TIM2 (for the AFC).'),
how: 'Q703 is a transistor used as a switch: R713/R714 divide LIM2_C so it turns on when the limiter output crosses about 2.2 V. R715 pulls the collector up to make LIM_SQ, and R716/R717 scale it to IF_CNT for the MCU.',
flow: '{V_th} ≈ 2.2 V',
}),
pump: () => ({
chain: [
IN('LIM_SQ(t): a square wave at f(t) = 455 kHz + 75 kHz · m(t)', 'm(t) is the audio, between −1 and +1: FM moves the frequency.'),
OP('Each cycle moves one packet of charge', 'C714, D702', 't', 'q = {C_714} ({V_pp} − 2{V_f}) = 22 pF × (4.6 − 0.6) V = 88 pC', 'Each rising edge pushes q through one diode; each falling edge refills C714 through the other.'),
OP('Packets per second × charge = current', '', 't', 'i(t) = f(t) · q = (455 kHz + 75 kHz · m(t)) × 88 pC = 40 µA + 6.6 µA · m(t)', 'Frequency has become current.'),
OP('Current into the integrator (time domain)', 'U701A, R718, C715', 't', '{C_f} [[d{v_o} || dt]] + [[{v_o} − {V_REF} || R]] = −i(t)', 'U701A holds its input at VREF_FM, so all of i(t) flows through R718 ∥ C715.'),
OP('Laplace transform it', '', 's', '{V_o}(s) − [[{V_REF} || s]] = −{I}(s) · [[R || 1 + sR{C_f}]], τ = R{C_f} = 51 kΩ × 1.5 nF = 76.5 µs',
'R is the transimpedance; the pole at 1/(2πτ) = 2.08 kHz is the US 75 µs de-emphasis.'),
OP('Put in the two parts of i(t)', '', 'jw', 'DC: −51 kΩ × 40 µA = −2.04 V, audio: −51 kΩ × 6.6 µA = −0.34 V per unit of m, 455 kHz ripple: ~~|{H}| ≈ 0.004~~'),
],
out: OUT('{v_o}(t) ≈ {V_REF} − 2.04 V − 0.34 V · {m_de}(t)', '{m_de} is the audio with the treble boost the station added taken back out (de-emphasis). The DC is removed later by C717.'),
how: 'C714 is a charge bucket and D702 the two valves. Because every cycle moves the same q, the average current is f × q. U701A turns that current into a voltage through R718, and C715 across it makes the 76.5 µs pole.',
flow: 'I = {f_IF} · q',
}),
fmaud: () => {
const a1 = skg(1, 15.8, 0.74), a19 = skg(19, 15.8, 0.74), a38 = skg(38, 15.8, 0.74);
return {
chain: [
IN('{v_i}(t) = a(t) + p cos(2π · 19 kHz · t) + s(t) cos(2π · 38 kHz · t) + …', 'The detector’s multiplex: a(t) = L+R audio, the 19 kHz pilot, the L−R stereo signal on 38 kHz, and RDS at 57 kHz.'),
OP('Sallen-Key low-pass (time domain)', 'U701B, R722, R723, C718, C719', 't', '[[1 || {ω_0}²]] [[d²{v_o} || dt²]] + [[1 || Q{ω_0}]] [[d{v_o} || dt]] + {v_o}(t) = {v_i}(t)'),
OP('Laplace transform it', '', 's', '{H}(s) = [[{ω_0}² || s² + ({ω_0}/Q) s + {ω_0}²]], {f_0} = [[1 || 2πR√({C_1}{C_2})]] = 15.8 kHz, Q = ½√([[{C_1} || {C_2}]]) = 0.74',
'R = 10 kΩ, {C_1} = 1.5 nF (C718), {C_2} = 680 pF (C719).'),
OP('Put in s = jω for each part', '', 'jw', '|{H}(j2π · 1 kHz)| = ' + n(a1, 2) + ', |{H}(j2π · 19 kHz)| = ' + n(a19, 2) + ', |{H}(j2π · 38 kHz)| = ' + n(a38, 2)),
OP('Block the DC and re-centre', 'C717, R721', 's', '{H_hp}(s) = [[sRC || 1 + sRC]], 1 / (2π · 100 kΩ · 1 µF) = 1.6 Hz', 'The detector’s −2.04 V offset is removed; the audio now sits on 1.65 V for the ADC.'),
],
out: OUT('{v_o}(t) ≈ 1.65 V + a(t) + ' + n(a19, 2) + 'p cos(2π · 19 kHz · t) + ' + n(a38, 2) + 's(t) cos(…)', 'The pilot is only 4.5 dB down here: the DSP’s FIR and notch remove it after the ADC.'),
how: 'U701B is a unity-gain follower. R722 and R723 are the two resistors; C718 runs from the middle node to the output, adding positive feedback that sharpens the knee; C719 goes to ground. C717 and R721 block the detector’s DC and re-centre the audio on 1.65 V.',
flow: '{f_0} = [[1 || 2πR√({C_1}{C_2})]]',
};
},
amf: () => {
const h0 = resp('cer455', 0.455, -6), hn = resp('cer455', 0.465, -51);
return {
chain: [
IN('{v_i}(t) = A[1 + m · a(t)] cos({ω_c}t) + B cos(({ω_c} + 2π · 10 kHz) t)', 'Your AM station on 455 kHz (carrier plus ±4.5 kHz of audio sidebands) and the next channel 10 kHz away.'),
OP('A narrow ceramic band-pass', 'FL601', 's', '{H}(s) ≈ band-pass at 455 kHz, BW = 9 kHz, Q ≈ [[455 kHz || 9 kHz]] ≈ 51'),
OP('Put in s = jω', 'R601 (2.7 kΩ termination)', 'jw', '|{H}(j{ω_c})| = ' + num(g(h0)) + ' (' + dbs(h0) + '), |{H}(j({ω_c} + 2π · 10 kHz))| = ' + num(g(hn)) + ' (' + dbs(hn) + ') ≈ 0'),
],
out: OUT('{v_o}(t) ≈ ' + num(g(h0)) + 'A[1 + m · a(t)] cos({ω_c}t) ~~+ ' + num(g(hn)) + 'B cos(({ω_c} + 2π · 10 kHz) t)~~', 'The next channel is gone; the sidebands up to ±4.5 kHz pass, which limits AM audio to 4.5 kHz.'),
how: 'FL601 is a 455 kHz ceramic resonator ladder, like FL501 but much narrower. R601 (2.7 kΩ) in parallel with the amplifier input is its load. VBIAS (R603/R604) is made here for the next stage.',
flow: 'BW = ±4.5 kHz',
};
},
vga: () => ({
chain: [
IN('{v_d}(t) = A[1 + m · a(t)] cos({ω_c}t)', 'The filtered AM signal across the first differential pair.'),
OP('A differential pair splits its tail current', 'Q601, Q603', 't', '{i_C1} − {i_C2} = {I_tail} tanh([[{v_d} || 2{V_T}]])'),
OP('Small signal: tanh x ≈ x', '', 't', 'tanh x = x ~~− [[x³ || 3]] + …~~', 'With {v_d} well under 2{V_T} = 52 mV the cube is negligible.'),
OP('Into one 2.2 kΩ collector load', 'R606, R611', 't', '{v_o} = [[{I_tail} {R_C} || 4{V_T}]] {v_d}'),
OP('The AGC voltage sets the tail current', 'Q602, Q604, R608, R609, R607, R612', 't', '{I_tail} = [[{V_AGC}/2 − {V_BE} || 2 kΩ]]', 'Gain proportional to current: the stage multiplies the signal by the AGC voltage.'),
],
out: OUT('{v_o}(t) = G({V_AGC}) · A[1 + m · a(t)] cos({ω_c}t), G = [[{I_tail} · 2.2 kΩ || 104 mV]]', 'From 19 per stage at 0.9 mA down to 0.2 at 10 µA: about 40 dB of range each, 80 dB for the pair.'),
how: 'Each BC847BS pair splits its tail current between two collectors according to the input difference, which is the tanh() law. Q602 and Q604 set the tail currents from V_AGC.',
flow: '{A} = [[{I_tail}{R_C} || 4{V_T}]]',
}),
det: () => ({
chain: [
IN('{v_IF}(t) = {A_c}[1 + m · a(t)] cos({ω_c}t)', 'The AM signal at 455 kHz: the audio a(t) is in the envelope.'),
OP('Post-amp', 'Q605', 't', '× 30', 'A common-emitter stage, about 2.2 kΩ / 70 Ω.'),
OP('The diode follows the peaks', 'D601', 't', '{v_C}(t) → 30{A_c}[1 + m · a(t)] − {V_f}', 'D601, a Schottky, conducts only near each positive peak and charges C612.'),
OP('The RC holds between peaks (time domain)', 'C612, R619', 't', 'RC [[d{v_C} || dt]] + {v_C} = peaks, needs [[1 || {f_c}]] ≪ RC ≪ [[1 || {f_audio}]]: 2.2 µs ≪ 22 µs ≪ 140 µs'),
OP('As a filter on the envelope', '', 's', '{H}(s) = [[1 || 1 + s · 22 µs]], |{H}(j2π · 455 kHz)| = 0.016 ≈ 0, |{H}(j2π · 5 kHz)| = 0.82', 'The carrier ripple is dropped; the audio passes.'),
],
out: OUT('{v_DET}(t) ≈ (30{A_c} − {V_f}) + 30{A_c} m · a(t) ~~+ ripple at 455 kHz~~', 'A DC level that tracks the station’s strength (for the AGC) plus the audio.'),
how: 'Q605 adds the last gain. D601 conducts near each positive peak and charges C612; R619 lets the voltage fall again between peaks. With RC much longer than one IF cycle but shorter than an audio cycle, the capacitor voltage traces the envelope.',
flow: '{v_DET} ≈ {A_c}[1 + m·a(t)]',
}),
agc: () => ({
chain: [
IN('{v_DET}(t) = {V_DC} + k · a(t)', '{V_DC} tracks the carrier strength; a(t) is the audio.'),
OP('Integrate the error (time domain)', 'U601A, R620, C614, R623', 't', '[[d{v_AGC} || dt]] = [[{V_REF} − {v_DET} || {R_620}{C_614}]], {V_REF} = 1.0 V'),
OP('Laplace: a PI controller', '', 's', '{C}(s) = −[[1 + s{R_623}{C_614} || s{R_620}{C_614}]]', 'An integrator (100 kΩ × 1 µF = 0.1 s) with a zero at 34 Hz from R623.'),
OP('Steady state: the integrator stops when its input is zero', '', 't', '[[d{v_AGC} || dt]] = 0 → {V_DC} = {V_REF} = 1.0 V', 'A strong station raises V_DET, V_AGC falls, the VGA’s gain falls, until V_DET is back at 1.0 V.'),
OP('Audio low-pass', 'U601B', 's', '{H}(s) = [[{ω_0}² || s² + ({ω_0}/Q) s + {ω_0}²]], {f_0} = 4.95 kHz, Q = 0.73'),
],
out: OUT('AM_AUDIO(t) ≈ k · a(t) up to 5 kHz, with {V_DC} held at 1.0 V', 'The same loudness for strong and weak stations.'),
how: 'U601A compares the detector’s DC with 1.0 V and integrates the error into V_AGC. U601B is the same Sallen-Key as the FM side, tuned to 4.95 kHz.',
flow: '[[d{V_AGC} || dt]] ∝ {V_REF} − {V_DET}',
}),
vt: (c) => {
const K = c.band === 'am' ? c.amK : c.fmK;
if (K.dac == null) return unreachable('VT for an out-of-reach station');
const w = PI2 * 1000, h = 1.45 / Math.sqrt(1 + Math.pow(w * 0.047, 2)) / Math.sqrt(1 + Math.pow(w * 0.01, 2));
return {
chain: [
IN('{V_DAC} = [[' + K.dac + ' || 4095]] × 3.3 V = ' + n(K.vdac, 3) + ' V', 'The ' + (c.band === 'am' ? 'AM' : 'FM') + ' DAC code for the station in the tuner.'),
OP('Non-inverting amplifier', 'U201, R201, R202', 't', '{V_T} = (1 + [[{R_201} || {R_202}]]) {V_DAC} = 1.45 × ' + n(K.vdac, 3) + ' V = ' + n(K.vt, 3) + ' V', '0 to 3.3 V from the DAC becomes 0 to 4.8 V for the varactor.'),
OP('Two RC poles (time domain)', 'R203, C201, R204, C202', 't', 'τ [[d{v} || dt]] + {v} = {v_in}, τ₁ = 47 ms, τ₂ = 10 ms'),
OP('Laplace transform it', '', 's', '{H}(s) = 1.45 · [[1 || 1 + s · 47 ms]] · [[1 || 1 + s · 10 ms]]', 'Poles at 3.4 Hz and 16 Hz.'),
OP('Any noise at 1 kHz', '', 'jw', '|{H}(j2π · 1 kHz)| = ' + num(h) + ' ≈ 0', 'Noise on the tuning voltage would frequency-modulate the oscillator, so it is filtered down to a few hertz.'),
],
out: OUT('{V_T}(t) ≈ ' + n(K.vt, 3) + ' V ~~+ noise~~', '1.17 mV per DAC code at the varactor.'),
how: 'U201 is a non-inverting amplifier: R201 from the output to the inverting input and R202 to ground set the 1.45 gain. R203/C201 and R204/C202 are the two RC poles.',
flow: '{V_T} = 1.45 · {V_DAC}',
};
},
pwm: (c) => {
const K = c.fmK, D = K.pwm / 4096, w = PI2 * 11.7e3;
const h = 1 / (1 + Math.pow(w * 0.01, 2)) / Math.sqrt(1 + Math.pow(w * 0.001, 2));
return {
chain: [
IN('{v_PWM}(t) = 3.3 V for a fraction D of each cycle, else 0, D = [[' + K.pwm + ' || 4096]] = ' + n(D, 3), 'TIM3 on PB1 at 48 MHz / 4096 = 11.7 kHz.'),
OP('Its Fourier series', '', 'f', '{v_PWM}(t) = D · 3.3 V + Σ [[2 · 3.3 V || kπ]] sin(kπD) cos(k{ω_PWM}t)', 'A DC average plus harmonics of 11.7 kHz.'),
OP('Two RC poles, then ×1.45, then one more', 'R209, C206, R210, C207, U202A, R213, C208', 's', '{H}(s) = [[1 || (1 + s · 10 ms)²]] · 1.45 · [[1 || 1 + s · 1 ms]]'),
OP('Put in s = jω', '', 'jw', '|{H}(0)| = 1.45, |{H}(j2π · 11.7 kHz)| = ' + num(h * 1.45) + ' ≈ 0', 'The ripple is gone; only the average is left.'),
],
out: OUT('{V_RF} = 1.45 · D · 3.3 V = ' + n(K.vtRf, 2) + ' V ~~+ ripple~~', 'That puts the RF tank at ' + n(K.tank, 2) + ' MHz.'),
how: 'The STM32’s two DACs are busy with the oscillators, so TIM3 makes a PWM on PB1. R209/C206 and R210/C207 average it, U202A multiplies by 1.45, and R213/C208 clean up the op-amp output.',
flow: '{V_RF} = 1.45 · D · 3.3 V',
};
},
band: (c) => ({
chain: [
IN((c.band === 'am' ? 'AM_EN_N' : 'FM_EN_N') + ' = 0 V', 'The firmware pulls the enable pin low to turn a band on.'),
OP('Base current', c.band === 'am' ? 'R220' : 'R218', 't', '{I_B} = [[5 V − {V_EB} || 1 kΩ]] = [[5 V − 0.7 V || 1 kΩ]] = 4.3 mA'),
OP('Saturate the switch', c.band === 'am' ? 'Q202' : 'Q201', 't', 'β{I_B} ≈ 100 × 4.3 mA ≫ 15 mA', 'Far more base drive than the front end’s current needs, so the PNP is fully on.'),
],
out: OUT('+5V_' + (c.band === 'am' ? 'AM' : 'FM') + ' ≈ 5 V − {V_CE(sat)} ≈ 4.9 V', 'At reset the pins float and R217/R219 hold the bases at 5 V: both bands start off.'),
how: 'Q201 and Q202 are PNP transistors with their emitters on +5VA. Pulling FM_EN_N or AM_EN_N low draws base current through R218/R220 and the transistor switches on, powering that band’s RF amp, oscillator and mixer.',
flow: 'EN low → band on',
}),
ui: () => ({
chain: [
IN('GPIO = 3.3 V', 'The firmware drives the LED pin high.'),
OP('The resistor takes what the LED does not', 'series resistor', 't', '{I_LED} = [[3.3 V − {V_f} || R]]'),
],
out: OUT('Green and blue: [[3.3 − 2.8 V || 220 Ω]] = 2.3 mA, yellow: [[3.3 − 2.0 V || 1 kΩ]] = 1.3 mA', ''),
how: 'Each LED hangs from a GPIO through a resistor that sets its current from the difference between 3.3 V and its forward voltage.',
flow: 'I = (3.3 V − {V_f}) / R',
}),
mcu: (c) => {
const C = c.fmK.c, fm = c.band !== 'am';
const chain = [
IN('x(t) = a(t)' + (fm ? ' + p cos(2π · 19 kHz · t) + …' : ''), 'The audio from the analog chain' + (fm ? ', with what is left of the pilot and subcarriers' : '') + ', on 1.65 V.'),
OP('Sample it', 'ADC, TIM15', 'z', 'x[n] = x(n{T_s}), {T_s} = [[1 || 192 kHz]]', 'Far faster than needed, so the analog filters only have to stop things above 96 kHz.'),
OP('32-tap FIR low-pass', 'firmware', 'z', 'y[n] = Σ_(k = 0…31) h[k] x[n − k], {H}(z) = Σ h[k] z⁻ᵏ', 'Flat to 15 kHz, at least 58 dB down (×0.0013) from 30 kHz.'),
OP('Keep every fourth sample', 'firmware', 'z', 'w[m] = y[4m]', '192 kHz / 4 = 48 kHz. Nothing above 24 kHz is left to fold back.'),
];
if (fm && C.notch) chain.push(OP('19 kHz notch', 'firmware', 'z', '{H}(z) = [[1 − 2 cos({ω_0}) z⁻¹ + z⁻² || 1 − 2r cos({ω_0}) z⁻¹ + r² z⁻²]], |{H}(e^(j{ω_0}))| = 0.0025 ≈ 0', 'Zeros on the unit circle at 19 kHz, poles just inside (r < 1) so the notch is narrow.'));
if (C.gain) chain.push(OP('Gain', 'firmware', 'z', 'w[m] × ' + n(Math.pow(10, C.gain / 20), 2) + ' (' + dbs(C.gain) + ')'));
return {
chain,
out: OUT(C.mute ? 'Muted: nothing goes to the PC' : 'z[m] ≈ a(m · 20.8 µs)' + (fm && C.notch ? ' ~~+ 0.0025p cos(…)~~' : fm ? ' + p cos(2π · 19 kHz · m · 20.8 µs)' : ''), 'Sent to the PC at 48 kHz as a USB microphone.'),
how: 'The STM32G0B1 samples the audio at 192 kHz, then does the sharp filtering digitally: the FIR removes everything above 15 kHz, keeping every fourth sample brings it down to 48 kHz, and the notch removes the 19 kHz pilot.',
flow: 'y[n] = Σ h[k] x[n − k]',
};
},
usb: () => ({
chain: [
IN('VBUS = 5 V', 'From the USB-C host, once it sees the 5.1 kΩ pull-downs on CC1/CC2 (R101, R102).'),
OP('Through the OR-ing diode', 'D105', 't', '{V_5V} = 5 V − {V_f} ≈ 4.7 V', 'D105 and D106 let USB or the machine-pin VIN supply the board without fighting.'),
OP('Power lost in the diode', 'D105', 't', '{P_D105} = {V_f} · I = 0.3 V × 85 mA ≈ 26 mW', 'It runs about 4 °C warm.'),
],
out: OUT('+5V ≈ 4.7 V, up to 500 mA (F101)', ''),
how: 'J101 brings in VBUS, D+ and D−. D105 and D106 OR the USB and VIN supplies, F101 limits the current, and U101 clamps ESD on the data lines.',
flow: '{R_CC} = 5.1 kΩ',
}),
reg: () => ({
chain: [
IN('{V_in} ≈ 4.7 V', 'The +5V rail after the OR-ing diode.'),
OP('Linear regulator', 'U102 (AP2112K)', 't', '{V_out} = 3.3 V, {P_LDO} = ({V_in} − {V_out}) · I = 1.4 V · I'),
OP('Ferrite and capacitor filters', 'FB101, FB102', 's', '{H}(s) = [[1 || 1 + s · L/R + s²LC]]', '600 Ω at 100 MHz with 22 µF / 1 µF: the MCU’s switching noise stays off +5VA and +3.3VA.'),
],
out: OUT('+3.3V for the MCU; +5VA and +3.3VA kept quiet for the RF and the ADC', ''),
how: 'U102 drops the 5 V rail to 3.3 V for the MCU. The ferrite beads FB101 and FB102 with their capacitors are LC low-pass filters that keep the MCU’s switching noise out of the analog rails.',
flow: '{V_out} = 3.3 V',
}),
};
})();
// Render the markup: {f_IF} variables, [[num || den]] fractions, ~~dropped terms~~. html() for the page, svg() for the diagram.
var MATHFMT = (function () {
const esc = (s) => String(s).replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>');
const VAR = /\{([^{}_^\[\]]+?)(?:_([^{}^\[\]]+))?(?:\^([^{}\[\]]+))?\}/g;
function inline(s) {
return esc(s).replace(VAR, (m, b, sub, sup) => '<i>' + b + '</i>' + (sub ? '<sub>' + sub + '</sub>' : '') + (sup ? '<sup>' + sup + '</sup>' : ''))
.replace(/\^\(([^()]*)\)/g, '<sup>$1</sup>').replace(/\^([−-]?[0-9.]+)/g, '<sup>$1</sup>');
}
function fracs(s) {
let out = '', i = 0;
while (i < s.length) {
const a = s.indexOf('[[', i);
if (a < 0) { out += inline(s.slice(i)); break; }
const b = s.indexOf(']]', a);
out += inline(s.slice(i, a));
const [num, den] = s.slice(a + 2, b).split('||');
out += '<span class="frac"><span class="fn">' + inline(num.trim()) + '</span><span class="fd">' + inline((den || '').trim()) + '</span></span>';
i = b + 2;
}
return out;
}
function html(s) {
return String(s).split('~~').map((part, k) => (k % 2 ? '<span class="drop" title="≈ 0: dropped">' + fracs(part) + '</span>' : fracs(part))).join('');
}
// SVG: dropped terms vanish, fractions become a/b inline, subscripts become shifted tspans
function svg(s) {
s = String(s).replace(/~~[^~]*~~/g, '');
s = s.replace(/\[\[\s*(.*?)\s*\|\|\s*(.*?)\s*\]\]/g, (m, a, b) => (/[ +−]/.test(a) ? '(' + a + ')' : a) + '/' + (/[ +−·]/.test(b) ? '(' + b + ')' : b));
let out = '', last = 0, m, pending = 0;
VAR.lastIndex = 0;
const plain = (t) => { if (!t) return; out += '<tspan' + (pending ? ' dy="' + pending + '"' : '') + '>' + esc(t) + '</tspan>'; pending = 0; };
while ((m = VAR.exec(s))) {
plain(s.slice(last, m.index));
out += '<tspan class="mv"' + (pending ? ' dy="' + pending + '"' : '') + '>' + esc(m[1]) + '</tspan>';
pending = 0;
if (m[2]) { out += '<tspan class="ms" dy="3">' + esc(m[2]) + '</tspan>'; pending = -3; }
last = VAR.lastIndex;
}
plain(s.slice(last));
if (pending) out += '<tspan dy="' + pending + '"> </tspan>';
return out;
}
return { html, svg };
})();
/* rfflow.js: the receiver drawn as an RF block diagram (standard symbols), with an equation under each step.
* RFFLOW.draw(eqOf) returns the SVG markup; eqOf(block) gives that block's compact equation (math.js markup).
* Every symbol group has data-id = its design.py block, so a click opens that block's schematic. */
var RFFLOW = (function () {
'use strict';
const esc = (s) => String(s).replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"');
// ---------------------------------------------------------------- symbols (centre x, y)
const tri = (x, y) => 'M' + (x - 20) + ',' + (y - 19) + 'L' + (x - 20) + ',' + (y + 19) + 'L' + (x + 21) + ',' + y + 'Z';
const arrowHead = (x, y, ang) => { const a = ang * Math.PI / 180, l = 6; return 'M' + x + ',' + y + 'L' + (x - l * Math.cos(a - 0.45)).toFixed(1) + ',' + (y - l * Math.sin(a - 0.45)).toFixed(1) + 'M' + x + ',' + y + 'L' + (x - l * Math.cos(a + 0.45)).toFixed(1) + ',' + (y - l * Math.sin(a + 0.45)).toFixed(1); };
const SYM = {
antenna: (x, y) => '<path class="s" d="M' + x + ',' + y + 'V' + (y - 30) + 'M' + (x - 13) + ',' + (y - 44) + 'L' + x + ',' + (y - 30) + 'L' + (x + 13) + ',' + (y - 44) + 'Z"/>',
filter: (x, y, o) => {
const k = o.kind, X0 = x - 16, X1 = x + 16, Yt = y - 8, Yb = y + 8;
const g = k === 'lp' ? 'M' + X0 + ',' + Yt + 'H' + (x + 2) + 'Q' + (x + 9) + ',' + Yt + ' ' + (x + 12) + ',' + Yb
: k === 'hp' ? 'M' + (x - 12) + ',' + Yb + 'Q' + (x - 9) + ',' + Yt + ' ' + (x - 2) + ',' + Yt + 'H' + X1
: 'M' + X0 + ',' + Yb + 'Q' + (x - 9) + ',' + Yb + ' ' + (x - 6) + ',' + Yt + 'H' + (x + 6) + 'Q' + (x + 9) + ',' + Yb + ' ' + X1 + ',' + Yb;
return '<rect class="s" x="' + (x - 24) + '" y="' + (y - 17) + '" width="48" height="34" rx="3"/><path class="g" d="' + g + '"/>' +
'<path class="gx" d="M' + X0 + ',' + (Yb + 4) + 'H' + X1 + '"/>';
},
amp: (x, y, o) => {
let s = '<path class="s" d="' + tri(x, y) + '"/>';
if (o.vga) s += '<path class="g" d="M' + (x - 14) + ',' + (y + 17) + 'L' + (x + 6) + ',' + (y - 17) + arrowHead(x + 6, y - 17, -60) + '"/>';
if (o.tuned) { // a varactor-tuned tank on the output: plates with an arrow, hung from the top edge
const t = y - 10;
s += '<path class="s" d="M' + x + ',' + t + 'V' + (t - 13) + 'M' + (x - 8) + ',' + (t - 13) + 'H' + (x + 8) + 'M' + (x - 8) + ',' + (t - 18) + 'H' + (x + 8) + 'M' + x + ',' + (t - 18) + 'V' + (t - 24) + '"/>' +
'<path class="g" d="M' + (x - 11) + ',' + (t - 8) + 'L' + (x + 11) + ',' + (t - 23) + arrowHead(x + 11, t - 23, -34) + '"/>';
}
if (o.text) s += '<text class="st" x="' + (x - 6) + '" y="' + (y + 4) + '" text-anchor="middle">' + esc(o.text) + '</text>';
return s;
},
mixer: (x, y) => '<circle class="s" cx="' + x + '" cy="' + y + '" r="17"/><path class="s" d="M' + (x - 12) + ',' + (y - 12) + 'L' + (x + 12) + ',' + (y + 12) + 'M' + (x + 12) + ',' + (y - 12) + 'L' + (x - 12) + ',' + (y + 12) + '"/>',
osc: (x, y, o) => {
let s = '<circle class="s" cx="' + x + '" cy="' + y + '" r="17"/><path class="g" d="M' + (x - 11) + ',' + y + 'C' + (x - 7) + ',' + (y - 13) + ' ' + (x - 3) + ',' + (y - 13) + ' ' + x + ',' + y + 'S' + (x + 7) + ',' + (y + 13) + ' ' + (x + 11) + ',' + y + '"/>';
if (o.vco) s += '<path class="g" d="M' + (x - 19) + ',' + (y + 19) + 'L' + (x + 19) + ',' + (y - 19) + arrowHead(x + 19, y - 19, -45) + '"/>';
if (o.xtal) s += '<path class="s" d="M' + (x - 34) + ',' + (y - 8) + 'V' + (y + 8) + 'M' + (x - 24) + ',' + (y - 8) + 'V' + (y + 8) + 'M' + (x - 24) + ',' + y + 'H' + (x - 17) + '"/><rect class="s" x="' + (x - 31.5) + '" y="' + (y - 10) + '" width="5" height="20"/>';
return s;
},
limiter: (x, y) => '<path class="s" d="' + tri(x, y) + '"/><path class="g" d="M' + (x - 15) + ',' + (y + 1) + 'L' + (x - 12) + ',' + (y - 6) + 'H' + (x - 6) + 'L' + (x - 3) + ',' + (y + 1) + 'L' + x + ',' + (y + 7) + 'H' + (x + 6) + 'L' + (x + 8) + ',' + (y + 2) + '"/>',
comparator: (x, y) => '<path class="s" d="' + tri(x, y) + '"/><path class="g" d="M' + (x - 15) + ',' + (y + 6) + 'H' + (x - 10) + 'V' + (y - 6) + 'H' + (x - 3) + 'V' + (y + 6) + 'H' + (x + 4) + 'V' + (y - 6) + 'H' + (x + 8) + '"/>',
disc: (x, y) => '<rect class="s" x="' + (x - 27) + '" y="' + (y - 17) + '" width="54" height="34" rx="3"/><text class="st" x="' + x + '" y="' + (y + 4) + '" text-anchor="middle">f → V</text>',
integ: (x, y, o) => {
const f = o.flip ? -1 : 1;
const d = 'M' + (x - 20 * f) + ',' + (y - 19) + 'L' + (x - 20 * f) + ',' + (y + 19) + 'L' + (x + 21 * f) + ',' + y + 'Z';
return '<path class="s" d="' + d + '"/><text class="st big" x="' + (x - 7 * f) + '" y="' + (y + 6) + '" text-anchor="middle">∫</text>';
},
diode: (x, y) => '<path class="s" d="M' + (x - 14) + ',' + y + 'H' + (x - 6) + 'M' + (x + 6) + ',' + (y - 8) + 'V' + (y + 8) + 'M' + (x + 6) + ',' + y + 'H' + (x + 14) + '"/><path class="sf" d="M' + (x - 6) + ',' + (y - 8) + 'L' + (x - 6) + ',' + (y + 8) + 'L' + (x + 6) + ',' + y + 'Z"/>' +
'<path class="s" d="M' + (x + 10) + ',' + y + 'V' + (y + 14) + 'M' + (x + 4) + ',' + (y + 14) + 'H' + (x + 16) + 'M' + (x + 4) + ',' + (y + 18) + 'H' + (x + 16) + 'M' + (x + 10) + ',' + (y + 18) + 'V' + (y + 24) + 'M' + (x + 5) + ',' + (y + 24) + 'H' + (x + 15) + '"/>',
vdiode: (x, y) => '<path class="s" d="M' + x + ',' + (y - 14) + 'V' + (y - 6) + 'M' + (x - 8) + ',' + (y + 6) + 'H' + (x + 8) + 'M' + x + ',' + (y + 6) + 'V' + (y + 14) + '"/><path class="sf" d="M' + (x - 8) + ',' + (y - 6) + 'L' + (x + 8) + ',' + (y - 6) + 'L' + x + ',' + (y + 6) + 'Z"/>',
sw: (x, y) => '<circle class="sf" cx="' + (x - 14) + '" cy="' + y + '" r="2.6"/><circle class="sf" cx="' + (x + 14) + '" cy="' + (y - 9) + '" r="2.6"/><circle class="sf" cx="' + (x + 14) + '" cy="' + (y + 9) + '" r="2.6"/><path class="s" d="M' + (x - 14) + ',' + y + 'L' + (x + 12) + ',' + (y - 8) + '"/>',
adc: (x, y) => '<path class="s" d="M' + (x - 24) + ',' + (y - 15) + 'H' + (x + 10) + 'L' + (x + 24) + ',' + y + 'L' + (x + 10) + ',' + (y + 15) + 'H' + (x - 24) + 'Z"/><text class="st" x="' + (x - 5) + '" y="' + (y + 4) + '" text-anchor="middle">ADC</text>',
box: (x, y, o) => '<rect class="s" x="' + (x - o.w / 2) + '" y="' + (y - o.h / 2) + '" width="' + o.w + '" height="' + o.h + '" rx="4"/>' +
(o.lines || []).map((t, i, a) => '<text class="st' + (i ? ' sm' : '') + '" x="' + x + '" y="' + (y + 4 + (i - (a.length - 1) / 2) * 13) + '" text-anchor="middle">' + esc(t) + '</text>').join(''),
led: (x, y) => '<path class="s" d="M' + (x - 14) + ',' + y + 'H' + (x - 6) + 'M' + (x + 6) + ',' + (y - 8) + 'V' + (y + 8) + 'M' + (x + 6) + ',' + y + 'H' + (x + 14) + '"/><path class="sf" d="M' + (x - 6) + ',' + (y - 8) + 'L' + (x - 6) + ',' + (y + 8) + 'L' + (x + 6) + ',' + y + 'Z"/><path class="g" d="M' + (x - 1) + ',' + (y - 11) + 'L' + (x + 5) + ',' + (y - 18) + arrowHead(x + 5, y - 18, -50) + 'M' + (x + 5) + ',' + (y - 10) + 'L' + (x + 11) + ',' + (y - 17) + arrowHead(x + 11, y - 17, -50) + '"/>',
pc: (x, y) => '<rect class="s" x="' + (x - 22) + '" y="' + (y - 17) + '" width="44" height="28" rx="2"/><path class="s" d="M' + (x - 8) + ',' + (y + 17) + 'H' + (x + 8) + 'M' + x + ',' + (y + 11) + 'V' + (y + 17) + '"/>',
};
// ---------------------------------------------------------------- layout: [block, symbol, x, y, options, label]
// label: [position, title, live key?]; the equation under the title comes from the block's math (flow form)
const N = [
['ant', 'antenna', 48, 290, {}, ['above', 'Antenna', null, true]],
['ant', 'filter', 150, 120, { kind: 'bp' }, ['below', 'Diplexer, FM leg']],
['ant', 'filter', 150, 460, { kind: 'lp' }, ['below', 'Diplexer, AM leg', null, true]],
['band', 'sw', 150, 290, {}, ['below', 'Band switch']],
['pwm', 'amp', 275, 36, { text: '×1.45' }, ['right', 'RF tracking (VT_RF)']],
['fmrf', 'amp', 275, 120, { tuned: true }, ['below', 'RF amp, tuned tank']],
['vt', 'amp', 300, 205, { text: '×1.45' }, null],
['vt', 'amp', 300, 375, { text: '×1.45' }, ['mid', 'Varactor drivers', null, false, [300, 284]]],
['fmlo', 'osc', 400, 205, { vco: true }, ['right', 'FM VCO', 'fmLO']],
['fmmix', 'mixer', 400, 120, {}, ['above', 'FM mixer', 'fmIF']],
['amrf', 'amp', 275, 460, {}, ['below', 'AM preamp']],
['amlo', 'osc', 400, 375, { vco: true }, ['right', 'AM VCO', 'amLO']],
['ammix', 'mixer', 400, 460, {}, ['below', 'AM mixer', 'amIF']],
['cf1', 'filter', 595, 290, { kind: 'bp' }, ['below', 'Filter 1, 10.7 MHz']],
['ifamp', 'amp', 720, 290, {}, ['below', 'IF amp']],
['ifamp', 'filter', 845, 290, { kind: 'bp' }, ['below', 'Filter 2, 10.7 MHz', null, true]],
['mix2', 'mixer', 955, 290, {}, ['above', 'Second mixer', 'if2']],
['xo', 'osc', 955, 395, { xtal: true }, ['below', 'Crystal LO']],
['lim', 'limiter', 130, 660, {}, ['below', 'Limiter ×2']],
['rssi', 'vdiode', 195, 730, {}, ['right', 'RSSI']],
['sq', 'comparator', 260, 660, {}, ['below', 'Squarer']],
['pump', 'disc', 400, 660, {}, ['below', 'Pulse-count detector', 'pumpI']],
['pump', 'integ', 530, 660, {}, ['below', 'De-emphasis', null, true]],
['fmaud', 'filter', 660, 660, { kind: 'lp' }, ['below', 'FM audio filter']],
['amf', 'filter', 130, 870, { kind: 'bp' }, ['above', '455 kHz filter']],
['vga', 'amp', 240, 870, { vga: true }, null],
['vga', 'amp', 330, 870, { vga: true }, ['mid', 'AGC amplifiers', null, false, [285, 816]]],
['det', 'amp', 430, 870, {}, null],
['det', 'diode', 530, 870, {}, ['mid', 'Post-amp & detector', null, false, [480, 816]]],
['agc', 'filter', 660, 870, { kind: 'lp' }, ['above', 'AM audio filter', null, true]],
['agc', 'integ', 520, 945, { flip: true }, ['below', 'AGC loop']],
['mcu', 'adc', 884, 660, {}, null],
['mcu', 'adc', 884, 870, {}, null],
['mcu', 'box', 990, 765, { w: 80, h: 64, lines: ['DSP', 'FIR ÷4, notch', 'AFC, seek'] }, ['mid', 'STM32G0B1', null, false, [1000, 642]]],
['usb', 'box', 1160, 765, { w: 62, h: 30, lines: ['USB-C'] }, ['below', 'USB']],
['pc', 'pc', 1160, 665, {}, ['above', 'PC: mic + serial port']],
['reg', 'box', 1160, 860, { w: 50, h: 28, lines: ['LDO'] }, ['below', 'Power']],
['ui', 'led', 1160, 945, {}, ['below', 'LEDs']],
];
// wires: [kind, [points], fromBlock, toBlock, arrow, label [text|@key, x, y, anchor]]
const W = [
['if', [[48, 290], [95, 290]], 'ant', 'ant', false],
['fm', [[95, 290], [95, 120], [124, 120]], 'ant', 'ant', true],
['am', [[95, 290], [95, 460], [124, 460]], 'ant', 'ant', true],
['fm', [[176, 120], [253, 120]], 'ant', 'fmrf', true, ['@fmRF', 214, 112]],
['ctrl', [[275, 56], [275, 87]], 'pwm', 'fmrf', true],
['fm', [[297, 120], [381, 120]], 'fmrf', 'fmmix', true],
['ctrl', [[322, 205], [381, 205]], 'vt', 'fmlo', true],
['fm', [[400, 186], [400, 139]], 'fmlo', 'fmmix', true],
['am', [[176, 460], [253, 460]], 'ant', 'amrf', true, ['@amRF', 214, 452]],
['am', [[297, 460], [381, 460]], 'amrf', 'ammix', true],
['ctrl', [[322, 375], [381, 375]], 'vt', 'amlo', true],
['am', [[400, 394], [400, 441]], 'amlo', 'ammix', true],
['fm', [[419, 120], [540, 120], [540, 290]], 'fmmix', 'cf1', false],
['am', [[419, 460], [540, 460], [540, 290]], 'ammix', 'cf1', false],
['if', [[540, 290], [569, 290]], 'fmmix', 'cf1', true],
['if', [[621, 290], [698, 290]], 'cf1', 'ifamp', true],
['if', [[743, 290], [819, 290]], 'ifamp', 'ifamp', true],
['if', [[871, 290], [936, 290]], 'ifamp', 'mix2', true],
['if', [[955, 376], [955, 309]], 'xo', 'mix2', true, ['10.240 MHz', 949, 348, 'end']],
['if', [[974, 290], [1015, 290], [1015, 548], [60, 548], [60, 660], [108, 660]], 'mix2', 'lim', true, ['455 kHz IF to both detectors', 530, 541]],
['if', [[60, 660], [60, 870], [104, 870]], 'mix2', 'amf', true],
['fm', [[152, 660], [238, 660]], 'lim', 'sq', true],
['fm', [[195, 660], [195, 714]], 'lim', 'rssi', true],
['fm', [[195, 744], [195, 782], [838, 782]], 'rssi', 'mcu', true, ['RSSI_FM', 760, 776]],
['dig', [[325, 660], [325, 798], [838, 798]], 'sq', 'mcu', true, ['IF_CNT → counter', 760, 810]],
['fm', [[282, 660], [371, 660]], 'sq', 'pump', true],
['fm', [[428, 660], [508, 660]], 'pump', 'pump', true],
['fm', [[552, 660], [634, 660]], 'pump', 'fmaud', true],
['fm', [[686, 660], [858, 660]], 'fmaud', 'mcu', true, ['FM audio', 770, 652]],
['am', [[156, 870], [218, 870]], 'amf', 'vga', true],
['am', [[262, 870], [308, 870]], 'vga', 'vga', true],
['am', [[352, 870], [408, 870]], 'vga', 'det', true],
['am', [[452, 870], [514, 870]], 'det', 'det', false],
['am', [[546, 870], [634, 870]], 'det', 'agc', true],
['am', [[686, 870], [858, 870]], 'agc', 'mcu', true, ['AM audio', 770, 862]],
['am loop', [[590, 870], [590, 945], [543, 945]], 'det', 'agc', true],
['am loop', [[498, 945], [240, 945], [240, 891]], 'agc', 'vga', true, ['V_AGC sets the gain', 370, 961]],
['am loop', [[330, 945], [330, 891]], 'agc', 'vga', true],
['dig', [[908, 660], [990, 660], [990, 731]], 'mcu', 'mcu', true],
['dig', [[908, 870], [990, 870], [990, 799]], 'mcu', 'mcu', true],
['dig', [[1032, 765], [1127, 765]], 'mcu', 'usb', true],
['dig', [[1160, 748], [1160, 685]], 'usb', 'pc', true],
['dig', [[1133, 860], [1082, 860]], 'reg', 'mcu', true],
['ctrl', [[1082, 945], [1144, 945]], 'mcu', 'ui', true],
// control bus from the MCU: DACs, PWM, band enables, calibration marker
['ctrl', [[880, 620], [880, 562], [225, 562], [225, 36], [253, 36]], 'mcu', 'pwm', true, ['DAC_FM, DAC_AM, PWM_RF, band enables, CAL_MARK', 560, 576]],
['ctrl', [[225, 205], [278, 205]], 'mcu', 'vt', true],
['ctrl', [[225, 375], [278, 375]], 'mcu', 'vt', true],
['ctrl', [[225, 290], [168, 290]], 'mcu', 'band', true],
['ctrl', [[225, 562], [30, 562], [30, 300], [44, 300]], 'mcu', 'ant', true, ['CAL_MARK', 34, 576, 'start']],
];
const JUNCTIONS = [[95, 290], [540, 290], [60, 660], [195, 660], [325, 660], [225, 205], [225, 375], [225, 290], [225, 562], [590, 870], [330, 945]];
function label(o, x, y, sym, lab, eq, group) {
const [pos, title, live, , at] = lab;
let tx = x, ty, an = 'middle';
const off = { antenna: [52, 0], filter: [17, 17], amp: [19, 19], mixer: [17, 17], osc: [17, 17], limiter: [19, 19], comparator: [19, 19], disc: [17, 17], integ: [19, 19], diode: [10, 24], vdiode: [14, 14], sw: [9, 9], adc: [15, 15], box: [16, 16], led: [18, 8], pc: [17, 17] }[sym] || [18, 18];
const lines = [['lt', title]];
if (eq) lines.push(['le', eq]);
if (live) lines.push(['lv', '@' + live]);
let y0;
if (pos === 'mid' && at) { tx = at[0]; y0 = at[1]; }
else if (pos === 'above') y0 = y - off[0] - 8 - (lines.length - 1) * 14;
else if (pos === 'below') y0 = y + off[1] + 16;
else if (pos === 'right') { tx = x + 24; an = 'start'; y0 = y - 6; }
lines.forEach(([cls, t], i) => {
const yy = y0 + i * 14;
if (cls === 'lv') o.push('<text class="lv" x="' + tx + '" y="' + yy + '" text-anchor="' + an + '" data-live="' + t.slice(1) + '"></text>');
else if (cls === 'le') o.push('<text class="le" x="' + tx + '" y="' + yy + '" text-anchor="' + an + '">' + MATHFMT.svg(t) + '</text>');
else o.push('<text class="lt" x="' + tx + '" y="' + yy + '" text-anchor="' + an + '">' + esc(t) + '</text>');
});
}
function draw(eqOf, groupOf) {
const o = [];
o.push('<defs>');
for (const k of ['fm', 'am', 'if', 'dig', 'ctrl']) o.push('<marker id="rfa-' + k + '" viewBox="0 0 8 8" refX="7.2" refY="4" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,0.6L8,4L0,7.4z" style="fill:var(--' + k + ')"/></marker>');
o.push('</defs>');
o.push('<text class="sec" x="20" y="22">Antenna to 455 kHz</text><text class="sec" x="20" y="610">455 kHz to the PC</text>');
// the MCU outline sits behind its contents
o.push('<g class="rf node dig" data-id="mcu"><rect class="mcubox" x="840" y="620" width="242" height="345" rx="8"/><text class="st sm" x="852" y="955">DACs, PWM, band enables, TIM1 marker ↑</text></g>');
for (const [kind, pts, a, b, arrow, lab] of W) {
const k = kind.split(' ')[0];
o.push('<g class="rfw ' + kind + '" data-b="' + a + ' ' + b + '"><path class="w ' + k + '" d="M' + pts.map((p) => p.join(',')).join('L') + '"' + (arrow ? ' marker-end="url(#rfa-' + k + ')"' : '') + '/>' +
(lab ? '<text class="wl' + (lab[0][0] === '@' ? ' dyn' : '') + '"' + (lab[0][0] === '@' ? ' data-live="' + lab[0].slice(1) + '"' : '') + ' x="' + lab[1] + '" y="' + lab[2] + '" text-anchor="' + (lab[3] || 'middle') + '">' + (lab[0][0] === '@' ? '' : esc(lab[0])) + '</text>' : '') + '</g>');
}
for (const [x, y] of JUNCTIONS) o.push('<circle class="jn" cx="' + x + '" cy="' + y + '" r="2.8"/>');
const seen = new Set();
for (const [id, sym, x, y, opt, lab] of N) {
const group = groupOf(id);
const first = !seen.has(id);
seen.add(id);
o.push('<g class="rf node ' + group + (id === 'pc' ? ' term' : '') + '" data-id="' + id + '"' + (id === 'pc' ? '' : ' tabindex="' + (first ? 0 : -1) + '" role="button"') + '>');
o.push('<rect class="hit" x="' + (x - 30) + '" y="' + (y - 30) + '" width="60" height="60"/>');
o.push(SYM[sym](x, y, opt || {}));
if (lab) label(o, x, y, sym, lab, lab[3] === true ? null : eqOf(id), group);
if (first && id !== 'pc') o.push('<path class="warn" data-warn="1" d="M' + (x + 16) + ',' + (y - 30) + 'l6,-10l6,10z" hidden="hidden"><title>Differs on the first board</title></path>');
o.push('</g>');
}
return o.join('');
}
return { draw, W: 1240, H: 1005, wires: W };
})();
// Explanations, flowchart layout and signal order for the AM/FM circuit explorer.
// Numbers come from tools/design.py (values, design notes) and firmware/README.md (first-board findings).
var GROUPS = {
fm: { name: 'FM path', short: 'FM' },
am: { name: 'AM path', short: 'AM' },
if: { name: 'Shared IF', short: 'IF' },
ctrl: { name: 'Tuning & control', short: 'Control' },
dig: { name: 'MCU, USB & power', short: 'Digital' },
};
// Signal order: what "Next" walks through. FM first, as in the walkthrough.
var ORDER = ['ant', 'fmrf', 'fmlo', 'fmmix', 'cf1', 'ifamp', 'mix2', 'xo', 'lim', 'rssi', 'sq', 'pump', 'fmaud',
'amrf', 'amlo', 'ammix', 'amf', 'vga', 'det', 'agc', 'vt', 'pwm', 'band', 'mcu', 'usb', 'reg', 'ui'];
var INFO = {
ant: {
title: 'Antenna & diplexer', group: 'fm', bands: ['fm', 'am'],
role: 'Splits one antenna into a medium-wave path and an FM path, and injects the calibration markers.',
text: [
'The SMA jack feeds one node, <code>ANT</code>, with two filters hanging off it. Each filter starts with the part that blocks the other band, so neither steals the other’s signal. The AM leg starts with a 2.2 µH series inductor, about 1.4 kΩ at 100 MHz. The FM leg starts with a 47 pF series capacitor, about 3.4 kΩ at 1 MHz.',
'The AM leg is a 5-pole, 2 MHz low-pass. The FM leg is a 70 MHz high-pass followed by a 130 MHz low-pass. That window removes AM, shortwave and strong VHF/UHF energy, but it is far too wide to pick out one station. Selecting the station is the RF amplifier’s job.',
'R317 and C323 let the MCU’s PA8 square wave onto the antenna node. Its harmonics are weak markers (about −60 dBm) at exactly known frequencies, which the firmware tunes to when it calibrates the oscillators.',
],
facts: [
'FM high-pass: 47 pF → 56 nH → 47 pF, corner 70 MHz',
'FM low-pass: 22 pF → 120 nH → 22 pF, corner 130 MHz (Butterworth for 50 Ω: 24.5 pF, 122 nH)',
'AM low-pass: 2.2 µH → 2.7 nF → 8.2 µH → 2.7 nF → 2.2 µH, corner 2 MHz',
'R301 (100 k) bleeds static off the antenna',
],
board: 'Since firmware v0.3 the markers come from a 48 MHz clock: harmonics at k × 48/N MHz.',
},
fmrf: {
title: 'FM RF amplifier', group: 'fm', bands: ['fm'],
role: 'Amplifies the FM band and acts as a band-pass filter that follows the station.',
text: [
'Q301 is a common-emitter amplifier on an MMBTH10 VHF transistor (f<sub>T</sub> 650 MHz), biased at about 4 mA by R303 and R304. The unbypassed 22 Ω emitter resistor R305 trades a little gain for linearity, so a strong local station does not overload the stage. R306 sets the DC current, and C308 shorts it out at RF.',
'The collector load is a parallel LC tank: L306 with C309, plus the BB910 varactor through C310. A tank is a high impedance, and so gives high gain, only near its resonant frequency. With 150 nH it needs about 21.8 pF to resonate at 88 MHz and 14.5 pF at 108 MHz. <code>VT_RF</code> sets the varactor’s share.',
'It has to track the station because of the image. With the LO 10.695 MHz above the station, a second frequency 21.39 MHz above the station also lands on the IF. That image is often in the aircraft band (118 to 137 MHz), which the antenna’s 130 MHz low-pass lets through. Only the tuned tank rejects it.',
'C310 (22 pF in series) blocks DC, keeps most of the RF voltage off the varactor so the signal does not modulate its capacitance, and narrows the tuning range to the band. C313 (4.7 pF) taps lightly into the mixer so the mixer does not load the tank’s Q.',
],
facts: [
'I<sub>C</sub> ≈ 4 mA; emitter: R305 22 Ω unbypassed + R306 82 Ω bypassed',
'Tank: 150 nH ∥ (3.3 pF + BB910 via 22 pF)',
'Image = station + 21.39 MHz',
'Supply: +5V_FM through R308 (47 Ω) = V_RF1',
],
board: 'The preselector is parked at PWM 2400 rather than swept per station; that gave the best quieting on the upper band, and the app’s “Peak it” re-peaks it by lowest hiss. Moving <code>VT_RF</code> pulls the LO by up to about 200 kHz through the mixer base.',
},
fmlo: {
title: 'FM local oscillator', group: 'fm', bands: ['fm'],
role: 'The voltage-controlled oscillator that does the tuning: 98.7 to 118.7 MHz by design.',
text: [
'A common-base Colpitts on Q302. C316 grounds the base for RF. The feedback divider, C318 (4.7 pF, collector to emitter) and C317 (15 pF, emitter to ground), returns part of the collector swing to the emitter in phase, so the stage oscillates at the tank’s resonance.',
'The tank is L307 (110 nH) with C319 (3.3 pF) and the BB910 varactor through C320 (22 pF). <code>VT_FM</code>, 0 to 4.8 V from the DAC and op-amp, reverse-biases the varactor: more voltage, less capacitance, higher frequency.',
'C321 (2.2 pF) injects a small sample of the LO into the mixer’s base. The firmware sets LO = station + 10.695 MHz.',
],
facts: [
'I<sub>E</sub> ≈ 2 mA (R312 330 Ω)',
'With 110 nH the tank needs 23.6 pF at 98.7 MHz and 16.3 pF at 118.7 MHz',
'Probe FLO (TP303) sits on the emitter, a low-impedance node, so it does not detune the tank',
],
board: 'Measured LO: 91.5 to 99.2 MHz, about 12 % low with half the range. That implies 23.4 to 27.5 pF in the tank instead of 16.3 to 23.6 pF. The board hears 87.5 to 88.5 MHz normally and 102.2 to 108 MHz with the LO below the station (the image side); 88.5 to 102 MHz is out of reach. The fix is less fixed capacitance or inductance (C319, L307), more varactor coupling (C320), then a re-calibration.',
},
fmmix: {
title: 'FM mixer', group: 'fm', bands: ['fm'],
role: 'Multiplies the station by the LO; the difference lands at 10.7 MHz.',
text: [
'Q303 is a single-transistor mixer. The RF (through C313) and the LO (through C321) both drive its base. The transistor’s exponential curve makes the collector current contain sum and difference products, and the 10.7 MHz ceramic filter downstream keeps only the difference.',
'The collector drives <code>IF_MIX</code>, the shared IF node. Its load is R501 (330 Ω) in the IF block, which is also the ceramic filter’s source impedance. The AM mixer’s collector joins the same node; only one front end is powered at a time.',
'Because the LO reaches this base, a little of it also leaks backwards through C313, the RF tank and Q301 to the antenna.',
],
facts: [
'I<sub>E</sub> ≈ 2 mA (design note); emitter R316 150 Ω bypassed by C322',
'IF = LO − RF = 10.695 MHz',
'Probe MIX (TP304) on IF_MIX',
],
board: 'The RF review estimated about −56 to −52 dBm of LO at the SMA through that leak path. The FCC 15.111 limit is 2 nW (−57 dBm), so measure it first.',
},
amrf: {
title: 'AM RF preamplifier', group: 'am', bands: ['am'],
role: 'A fixed broadband preamp for 530 to 1700 kHz.',
text: [
'Q401 (MMBT3904) is a common-emitter stage at about 3.8 mA with a 470 Ω collector load, about 24 dB of gain. R401 (51 Ω) terminates the 2 MHz low-pass so the filter sees its design impedance.',
'There is no tuning here. The AM LO sits up at 11 to 12 MHz, so the image lands at 22 to 23 MHz, far above the 2 MHz low-pass. A fixed broadband preamp is enough.',
],
facts: ['Emitter: R405 22 Ω unbypassed + R406 56 Ω bypassed', 'Supply: +5V_AM through R402 (47 Ω) = V_AM1', 'Probes AMIN (TP403) and ARF (TP404)'],
},
amlo: {
title: 'AM local oscillator', group: 'am', bands: ['am'],
role: 'Voltage-controlled oscillator at 11.23 to 12.4 MHz by design.',
text: [
'A Clapp oscillator on Q402. The frequency is set by L401 (8.2 µH) in series with C410 (15 pF) and the BB910 varactor through C411 (33 pF). C408 (220 pF, base to emitter) and C409 (470 pF, emitter to ground) form the feedback divider. The tank’s series capacitance is much smaller than the divider’s, so the transistor’s own capacitances barely move the frequency.',
'<code>VT_AM</code> tunes it. The output is taken at the emitter and coupled to the AM mixer through C412 (47 pF).',
'Converting AM up to 10.7 MHz, instead of down to 455 kHz, means the VCO only needs a 1.1 : 1 range, and the image is easy to filter.',
],
facts: ['LO = station + 10.695 MHz: 11.225 MHz at 530 kHz, 12.395 MHz at 1700 kHz', 'Probe ALO (TP405) on the emitter'],
board: 'Measured LO: 9.55 to 10.16 MHz. The firmware receives with the mixer’s sum product instead (LO + station = 10.695 MHz), which covers about 533 to 1150 kHz. A scan found 820 kHz (WBAP).',
},
ammix: {
title: 'AM mixer', group: 'am', bands: ['am'],
role: 'Same topology as the FM mixer; its collector joins the shared IF node.',
text: [
'Q403 mixes the preamp output (through C405) with the LO (through C412) at its base. Its collector shares <code>IF_MIX</code> and the 330 Ω load with the FM mixer. The band switch powers only one front end at a time, so the idle mixer sits unbiased and does not load the node.',
],
facts: ['Emitter: R415 150 Ω bypassed by C413', 'IF = LO − RF = 10.695 MHz (by design)'],
},
cf1: {
title: 'Mixer load & first 10.7 MHz filter', group: 'if', bands: ['fm', 'am'],
role: 'Loads the mixers and starts the channel selection at 10.7 MHz.',
text: [
'R501 (330 Ω) from V_IF1 is the mixers’ collector load and the ceramic filter’s source impedance; R503 (330 Ω) terminates its output. A ceramic filter only shows its specified shape between the right impedances.',
'C502 (22 pF) shunts the VHF LO feed-through on <code>IF_MIX</code> before it reaches the filter.',
'FL501 passes about 180 kHz around 10.7 MHz, wide enough for FM’s ±75 kHz deviation. On AM it removes far-off signals; the narrow 455 kHz filter does the AM channel selection later.',
],
facts: ['HCCF3-10.700, 7 × 3 mm SMD, 330 Ω in and out', 'V_IF1 = +5VA through R502 (22 Ω)', 'Probe CF1 (TP503) on the filter output'],
},
ifamp: {
title: '10.7 MHz IF amplifier & second filter', group: 'if', bands: ['fm', 'am'],
role: 'Makes up the filter losses, then filters again for steeper skirts.',
text: [
'Q501 is a common-emitter stage at about 3.9 mA with a 330 Ω collector load, which is again the next filter’s source impedance. It gives about 15 dB.',
'FL502 is the same 10.7 MHz part. Two filters in cascade have much steeper skirts than one.',
],
facts: ['Gain ≈ 15 dB, I<sub>C</sub> ≈ 3.9 mA', 'Probe IF1 (TP504) on the collector; 10M7 (MC20) on the filter output'],
},
mix2: {
title: 'Second mixer', group: 'if', bands: ['fm', 'am'],
role: 'Converts the 10.695 MHz IF down to 455 kHz.',
text: [
'Q502 mixes the IF (through C508) with the 10.240 MHz crystal oscillator (through C509) at its base. The difference, 10.695 − 10.240 = 0.455 MHz, appears across the 1.5 kΩ collector load. C511 (100 pF) rolls off the 10 MHz products.',
'<code>IF2_OUT</code> feeds both 455 kHz chains at once: the AM filter and the FM limiter.',
],
facts: ['I<sub>E</sub> ≈ 1.8 mA from the bias values (the design note says 1.4 mA)', 'Probe 455K (MC21) on IF2_OUT'],
},
xo: {
title: '10.24 MHz crystal oscillator', group: 'if', bands: ['fm', 'am'],
role: 'A fixed, crystal-accurate second LO.',
text: [
'Q503 is a Colpitts with the crystal Y501 in its base circuit. C514 and C515 (100 and 220 pF) form the feedback divider, and C516 trims the crystal’s load.',
'The design uses a 10.240 MHz crystal because JLC stocks it (10.245 MHz parts are scarce). So the first IF is 10.695 MHz rather than 10.700: the firmware sets LO1 = station + 10.695 MHz, and the 5 kHz offset sits far inside the 180 kHz filters.',
],
facts: ['I<sub>E</sub> ≈ 1.1 mA', 'Probe XO (TP505) on the emitter'],
board: 'From the RF review: Y501’s 9th and 10th harmonics (92.16 and 102.4 MHz) fall in the FM band.',
},
lim: {
title: 'Limiter', group: 'fm', bands: ['fm', 'am'],
role: 'Clips the 455 kHz IF to a constant amplitude, so only its frequency matters.',
text: [
'An RC low-pass (R702 2.2 kΩ, C704 150 pF, about 480 kHz) takes off what is left of the 10 MHz products. Two identical common-emitter stages (Q701, Q702, about 33 dB each) then amplify until the signal is hard-clipped.',
'FM carries its audio in the frequency, so the amplitude, along with most noise and fading, can be thrown away.',
],
facts: ['I<sub>C</sub> ≈ 0.95 mA per stage, 2.2 kΩ loads', 'Probes LIM1 (TP702) and LIM2 (TP703)', 'Also used on AM: the IF counter needs the squared-up IF on both bands'],
},
rssi: {
title: 'FM signal-strength detector', group: 'fm', bands: ['fm'],
role: 'Was meant to rank stations during seek.',
text: [
'D701 rectifies the first limiter stage’s output into C712 and R712, and the DC goes to PA6 as <code>RSSI_FM</code>. The idea was that stage 1 would still follow the signal level before it limits.',
],
facts: ['Probe RSF (TP704)'],
board: '<code>RSSI_FM</code> sits at 85 to 100 mV with or without a station, because stage 1 already limits on noise. The firmware ignores it. It detects carriers with a hiss meter on the audio, plus a check that the IF follows the LO when the DAC is nudged.',
},
sq: {
title: 'Squarer & IF counter output', group: 'fm', bands: ['fm', 'am'],
role: 'Makes a clean square wave for the detector and for the MCU’s frequency counter.',
text: [
'Q703 is a saturating switch DC-coupled from the second limiter, switching at about 2.2 V on <code>LIM2_C</code>; C713 speeds up the edges. Its collector, <code>LIM_SQ</code>, swings 0 to about 4.6 V and drives the diode pump.',
'R716 and R717 divide it to about 3 V, a valid logic high, as <code>IF_CNT</code>, which TIM2 counts on PA15. The MCU measures the IF to the hertz, and that one number drives AFC, seek and calibration on both bands.',
],
facts: ['Probe SQ (MC24) on LIM_SQ, CNT (TP705) on IF_CNT'],
},
pump: {
title: 'Pulse-count FM detector', group: 'fm', bands: ['fm'],
role: 'Turns frequency into a voltage: this is the FM demodulator.',
text: [
'On every IF cycle, C714 (22 pF) charges through one diode of D702 and discharges through the other into U701A’s summing junction. Each cycle moves the same packet of charge, C · (V<sub>pp</sub> − 2V<sub>f</sub>), so the average current is proportional to the number of cycles per second: about 40 µA at 455 kHz, ±6.6 µA for ±75 kHz of deviation.',
'U701A is an integrator. R718 (51 kΩ) turns the current into a voltage, and C715 (1.5 nF) across it gives the 75 µs de-emphasis that undoes the broadcaster’s treble boost. <code>FM_DEMOD</code> sits around 1.6 to 1.8 V with no modulation.',
],
facts: ['VREF_FM is 78 % of V_IF4 (R725 1.2 k / R726 4.3 k): about 3.6 V with the real ~4.6 V supply after the OR-ing diode, 3.9 V at a full 5 V', 'FM_DEMOD sits about 2 V below VREF_FM (40 µA × 51 kΩ)', '51 kΩ ∥ 1.5 nF = 76.5 µs; 1 nF would give 50 µs for Europe', 'Probe DEM (MC23) on FM_DEMOD'],
},
fmaud: {
title: 'AFC output & FM audio filter', group: 'fm', bands: ['fm'],
role: 'Splits the detector output into a slow tuning-error voltage and filtered audio.',
text: [
'<code>FM_DC</code> is FM_DEMOD × 2/3 through a 67 ms filter ((R719 ∥ R720) × C716): the average tuning error.',
'The audio goes through C717, is re-centred on 1.65 V (the middle of the 3.3 V ADC range), and passes U701B, a unity-gain Sallen-Key low-pass at 15.8 kHz meant to keep the 19 kHz pilot out. R724 limits the current into the ADC pin if the 5 V op-amp swings high.',
],
facts: ['Sallen-Key: 10 k / 10 k, 1.5 nF / 680 pF → 15.8 kHz', 'Probes FMDC (TP707), FMA (TP708); edge contact FM (MC16)'],
board: 'Two poles could not stop the stereo subcarrier (23 to 53 kHz) from aliasing at 48 kHz. Since firmware v0.4 the ADC samples at 192 kHz and a 32-tap FIR decimates to 48 kHz; the pilot is now −73 dB.',
},
amf: {
title: '455 kHz AM filter & bias', group: 'am', bands: ['am'],
role: 'Sets the AM channel width: ±4.5 kHz.',
text: [
'FL601 is the AM selectivity. It passes ±4.5 kHz around 455 kHz and rejects the neighbouring channels 10 kHz away. It is specified with 2 kΩ at both ends. The output side gets about that: R601 (2.7 kΩ) in parallel with the amplifier input. The input side sees less, because the second mixer’s 1.5 kΩ load is shared with the FM limiter’s input on the same node.',
'R603 and R604 make <code>VBIAS</code> (about 2.9 V), which biases both differential pairs.',
],
facts: ['Probes AMF (TP603), VB (TP602), VIF3 (TP601)'],
board: 'AM fault: nothing gets from here to the detector. <code>RSSI_AM</code> stays at 2.39 V even with a −40 dBm marker centred on 455 kHz. FL601’s signal pads measured open, so it is not fitted backwards. The next step is the DC survey in the firmware README.',
},
vga: {
title: 'AGC amplifiers', group: 'am', bands: ['am'],
role: 'Two differential pairs whose gain the AGC loop sets.',
text: [
'Each BC847BS pair (Q601, Q603) amplifies the difference between its input and VBIAS. A differential pair’s gain is proportional to its tail current, I<sub>tail</sub> · R<sub>C</sub> / (4 V<sub>T</sub>): about ×19 at 0.9 mA and ×0.2 at 10 µA, so each stage spans about 40 dB.',
'Q602 and Q604 set the tail currents from <code>AGC_B</code>, which is V_AGC divided by two.',
],
facts: ['R<sub>C</sub> = 2.2 kΩ; tail emitter resistors 2 kΩ', 'Probes VGA1 (TP604), VGA2 (TP605)'],
},
det: {
title: 'IF post-amp & envelope detector', group: 'am', bands: ['am'],
role: 'Final 455 kHz gain, then a diode recovers the audio envelope.',
text: [
'Q605 adds about ×30 at 1.1 mA. D601, a Schottky, charges C612 (2.2 nF) to the peaks of the IF, and R619 (10 kΩ) lets it follow the audio: a 22 µs time constant.',
'The result, <code>AM_DET</code>, is the audio riding on a DC level proportional to the carrier.',
],
facts: ['Probe AIF (TP606) on the post-amp; DET (MC22) on AM_DET'],
},
agc: {
title: 'AGC loop, RSSI & AM audio', group: 'am', bands: ['am'],
role: 'Holds the detector at a constant level and filters the audio.',
text: [
'U601A integrates the difference between AM_DET and a 1.0 V reference and drives <code>V_AGC</code>, which sets the amplifier tail currents. A stronger station gives more DC at the detector, which lowers V_AGC and the gain. <code>RSSI_AM</code> (V_AGC / 2) tells the MCU the gain setting: lower means stronger.',
'U601B is a 5 kHz Sallen-Key low-pass, and the audio is re-centred on 1.65 V for the ADC as <code>AM_AUDIO</code> on PA0.',
],
facts: ['Reference: R621 39 k / R622 10 k from V_IF3 ≈ 1.0 V', 'Sallen-Key: 10 k / 10 k, 4.7 nF / 2.2 nF → 4.95 kHz', 'Probes AGC (TP607), RSA (TP608), AMA (TP609); edge contact AM (MC15)'],
board: '<code>RSSI_AM</code> sits at its 2.39 V rail (maximum gain), because the detector never reaches the setpoint. See the AM filter block.',
},
vt: {
title: 'Varactor drivers', group: 'ctrl', bands: ['fm', 'am'],
role: 'Scales the MCU’s DACs (0 to 3.3 V) up to the 0 to 4.8 V tuning voltages.',
text: [
'U201 runs both channels as non-inverting amplifiers with a gain of 1 + 10k/22k = 1.45. Two RC poles follow each output (10 kΩ with 4.7 µF, then 10 kΩ with 1 µF). Noise on a tuning voltage frequency-modulates the oscillator, so it is filtered hard.',
'<code>VT_FM</code> tunes the FM oscillator and <code>VT_AM</code> the AM oscillator.',
],
facts: ['12-bit DAC: 0.81 mV per code, 1.17 mV per code at the varactor', 'Poles at about 3.4 Hz and 16 Hz', 'Probes DACF/DACA (TP201/202), VTF1/VTA1 (TP204/205); VTF, VTA (MC25, MC26)'],
board: 'The tuning voltage floors near 0 V: the FM LO flattens below about DAC code 200, probably at the op-amp’s output limit.',
},
pwm: {
title: 'RF tracking voltage & 1.65 V reference', group: 'ctrl', bands: ['fm'],
role: 'A PWM “third DAC” for the FM preselector, plus the audio bias reference.',
text: [
'The STM32 has two DAC channels and both are used for the oscillators. So <code>VT_RF</code> comes from a PWM on PB1, smoothed by two RC poles (about 16 Hz) and scaled ×1.45 by U202A.',
'U202B buffers half of +3.3VA to make <code>VREF_1V65</code>, the bias for both audio filters, so the audio sits in the middle of the ADC range.',
],
facts: ['A third pole after the amplifier: R213 1 k\u03a9 with C208 1 \u00b5F, about 160 Hz', 'Probes PWM (TP203), VTR1 (TP206), VREF (TP207); VTR (MC27)'],
},
band: {
title: 'Band switches', group: 'ctrl', bands: ['fm', 'am'],
role: 'Powers one front end at a time.',
text: [
'Q201 and Q202 are PNP high-side switches from +5VA. The MCU pulls <code>FM_EN_N</code> or <code>AM_EN_N</code> low (open-drain, 5 V tolerant) to turn a band on. At reset the pins float, and the 10 kΩ pull-ups keep both bands off.',
'Only the selected front end’s RF amp, oscillator and mixer are powered, which is how the two mixers can share one IF node.',
],
facts: ['Probes 5VFM (TP208), 5VAM (TP209); 5VA (MC28)'],
},
ui: {
title: 'Status LEDs', group: 'ctrl', bands: ['fm', 'am'],
role: 'Band and USB status.',
text: [
'Green is FM, yellow is AM and blue is USB/status, all driven from 3.3 V GPIOs (PB13-PB15). The green and blue LEDs drop about 2.8 V, so they use 220 Ω; the yellow uses 1 kΩ. Everything else is controlled from the PC.',
],
facts: [],
},
mcu: {
title: 'STM32G0B1 microcontroller', group: 'dig', bands: ['fm', 'am'],
role: 'Tunes, calibrates, digitises the audio and talks USB.',
text: [
'A Cortex-M0+ with a 12-bit ADC, two 12-bit DACs and full-speed USB. DAC1 (PA4, PA5) drives the varactor amplifiers. TIM3 on PB1 makes the VT_RF PWM, TIM1 on PA8 makes the calibration markers, and TIM2 counts the IF on PA15. PB8 and PB9 switch the bands.',
'The ADC samples the active band’s audio at 192 kHz. Every millisecond the DSP decimates to 48 kHz with a 32-tap FIR, notches the 19 kHz pilot, cancels the board’s own 1 kHz hum, applies the noise filter and a soft limiter, and hands 48 samples to USB.',
'On the PC it is a USB microphone (48 kHz, 16-bit mono) plus a serial port for commands. A blank chip boots ST’s ROM USB DFU, so the first flash and every update go over the same cable.',
],
facts: ['40 MHz crystal Y101: harmonics at 80 and 120 MHz, clear of the FM band and the LO range', 'Everything runs at 48 MHz; USB is clocked from the crystal since v0.3', 'SWD, UART and BOOT are optional contacts down the left edge'],
board: 'USB on the internal 48 MHz RC oscillator failed once the board was warm, so v0.3 moved USB onto the crystal. The DSP’s 1 ms burst leaks through VREF+ as a 1 kHz tone, which the firmware cancels (−39 → −60 dBFS).',
},
usb: {
title: 'USB-C, power input & ESD', group: 'dig', bands: ['fm', 'am'],
role: 'One cable for power, audio, control and firmware.',
text: [
'J101 is a USB 2.0 Type-C receptacle. R101 and R102 (5.1 kΩ) on CC1 and CC2 tell the host this is a device that wants 5 V. U101 (USBLC6) clamps ESD on D+ and D−.',
'5 V can also come in on the VIN machine contact (MC1). Two B5819W Schottky diodes OR the two sources, and a 500 mA polyfuse feeds the +5V rail. The red LED shows power.',
],
facts: ['Draw ≈ 85 mA with FM on; D105 is the warmest part, +4.3 °C (Adom Fields)', 'Probes VBUS, VIN, VOR, 5V (TP101-TP104)'],
},
reg: {
title: '3.3 V regulator & analog rails', group: 'dig', bands: ['fm', 'am'],
role: 'Makes 3.3 V and the filtered analog supplies.',
text: [
'U102 (AP2112K) makes +3V3 for the MCU. Ferrite beads split off <code>+5VA</code>, which feeds every RF and IF stage and the op-amps (each stage adds its own RC decoupling), and <code>+3.3VA</code>, the MCU’s VREF+ for the ADC and DACs.',
],
facts: ['Probes 3V3, 3V3A, 5VA (TP105-TP107)'],
board: 'VREF+ has one ferrite plus 1 µF / 10 nF. That lets the DSP’s 1 kHz current pulse into the audio; the next revision should filter it harder.',
},
};
// Flowchart geometry (SVG user units). Nodes: [x, y, w, h]. Edges: [from, to, kind, points, label?, labelPos?]
var FLOW = {
w: 1120, h: 770,
sections: [[20, 30, 'Antenna to 455 kHz'], [20, 428, 'Detectors & USB']],
nodes: {
ant: [10, 160, 132, 70, 'Antenna + diplexer', 'SMA \u2192 AM / FM'],
fmrf: [170, 50, 120, 56, 'FM RF amp', 'Q301 \u00b7 tuned tank'],
pwm: [170, 128, 120, 44, 'RF tracking', 'PWM → VT_RF'],
vt: [170, 186, 120, 50, 'Varactor drivers', 'DAC → VT_FM, VT_AM'],
amrf: [170, 282, 120, 56, 'AM preamp', 'Q401 · 24 dB'],
fmmix: [335, 50, 120, 56, 'FM mixer', 'Q303 → 10.7 MHz'],
fmlo: [335, 128, 120, 50, 'FM oscillator', '98.7 to 118.7 MHz'],
amlo: [335, 210, 120, 50, 'AM oscillator', '11.2 to 12.4 MHz'],
ammix: [335, 282, 120, 56, 'AM mixer', 'Q403 → 10.7 MHz'],
cf1: [500, 167, 110, 56, '10.7 MHz filter', 'FL501 · 330 Ω'],
ifamp: [655, 167, 110, 56, 'IF amp + filter', 'Q501 · FL502'],
mix2: [810, 167, 120, 56, 'Second mixer', 'Q502 → 455 kHz'],
xo: [810, 262, 120, 50, 'Crystal LO', '10.240 MHz \u00b7 Q503'],
lim: [170, 440, 120, 56, 'Limiter', 'Q701, Q702'],
rssi: [170, 520, 120, 44, 'FM RSSI', 'D701 \u2192 RSSI_FM'],
sq: [330, 440, 110, 56, 'Squarer', 'Q703 → IF_CNT'],
pump: [480, 440, 130, 56, 'FM detector', 'diode pump · U701A'],
fmaud: [650, 440, 120, 56, 'FM audio filter', 'U701B · 15.8 kHz'],
amf: [170, 630, 120, 56, '455 kHz AM filter', 'FL601 · ±4.5 kHz'],
vga: [330, 630, 110, 56, 'AGC amplifiers', 'Q601, Q603 pairs'],
det: [480, 630, 130, 56, 'Envelope detector', 'Q605 · D601'],
agc: [650, 630, 120, 56, 'AGC + AM audio', 'U601 · 5 kHz'],
mcu: [830, 430, 150, 300, 'STM32G0B1', 'ADC · DSP · USB'],
pc: [1000, 432, 110, 40, 'PC', 'mic + serial port'],
usb: [1000, 490, 110, 56, 'USB-C', 'power · ESD'],
reg: [1000, 566, 110, 50, '3.3 V LDO', 'rails + filters'],
ui: [1000, 636, 110, 40, 'Status LEDs', 'PB13-PB15'],
band: [1000, 696, 110, 50, 'Band switches', 'Q201, Q202'],
},
mcuPins: [['PA0 / PA1', 'audio ADC'], ['PA2 / PA6', 'RSSI ADC'], ['PA3', 'FM_DC ADC'], ['PA4 / PA5', 'tuning DACs'], ['PB1', 'VT_RF PWM'],
['PA15', 'IF counter'], ['PA8', 'cal markers'], ['PB8 / PB9', 'band enables'], ['PA11 / 12', 'USB']],
edges: [
['ant', 'fmrf', 'fm', [[75, 160], [75, 78], [170, 78]], '@rf', [122, 71]],
['ant', 'amrf', 'am', [[75, 230], [75, 310], [170, 310]], '@rf', [122, 303]],
['fmrf', 'fmmix', 'fm', [[290, 78], [335, 78]]],
['fmlo', 'fmmix', 'fm', [[395, 128], [395, 106]], '@lo', [401, 122, 'start']],
['amrf', 'ammix', 'am', [[290, 310], [335, 310]]],
['amlo', 'ammix', 'am', [[395, 260], [395, 282]], '@lo', [401, 276, 'start']],
['fmmix', 'cf1', 'fm', [[455, 78], [478, 78], [478, 195], [500, 195]]],
['ammix', 'cf1', 'am', [[455, 310], [478, 310], [478, 195]]],
['cf1', 'ifamp', 'if', [[610, 195], [655, 195]]],
['ifamp', 'mix2', 'if', [[765, 195], [810, 195]]],
['xo', 'mix2', 'if', [[870, 262], [870, 223]], '10.240 MHz', [876, 247, 'start']],
['mix2', 'lim', 'if', [[930, 195], [970, 195], [970, 400], [140, 400], [140, 468], [170, 468]], '455 kHz IF (IF2_OUT) to both detectors', [560, 393]],
['mix2', 'amf', 'if', [[140, 400], [140, 658], [170, 658]]],
['lim', 'sq', 'fm', [[290, 468], [330, 468]]],
['lim', 'rssi', 'fm', [[230, 496], [230, 520]]],
['sq', 'pump', 'fm', [[440, 468], [480, 468]]],
['pump', 'fmaud', 'fm', [[610, 468], [650, 468]]],
['fmaud', 'mcu', 'fm', [[770, 458], [830, 458]], 'FM audio', [800, 451]],
['fmaud', 'mcu', 'fm', [[770, 480], [830, 480]], 'FM_DC', [800, 493]],
['rssi', 'mcu', 'fm', [[290, 542], [830, 542]], 'RSSI_FM', [700, 536]],
['sq', 'mcu', 'dig', [[385, 496], [385, 590], [830, 590]], 'IF_CNT: the IF counter (TIM2)', [610, 584]],
['amf', 'vga', 'am', [[290, 658], [330, 658]]],
['vga', 'det', 'am', [[440, 658], [480, 658]]],
['det', 'agc', 'am', [[610, 658], [650, 658]]],
['agc', 'mcu', 'am', [[770, 648], [830, 648]], 'AM audio', [800, 641]],
['agc', 'mcu', 'am', [[770, 670], [830, 670]], 'RSSI_AM', [800, 683]],
['agc', 'vga', 'am', [[710, 686], [710, 714], [385, 714], [385, 686]], 'V_AGC sets the gain', [548, 728]],
['mcu', 'usb', 'dig', [[980, 518], [1000, 518]]],
['usb', 'pc', 'dig', [[1055, 490], [1055, 472]]],
['reg', 'mcu', 'dig', [[1000, 591], [980, 591]]],
['mcu', 'ui', 'ctrl', [[980, 656], [1000, 656]]],
['mcu', 'band', 'ctrl', [[980, 716], [1000, 716]]],
['mcu', 'vt', 'ctrl', [[880, 430], [880, 372], [150, 372], [150, 211], [170, 211]], 'DAC_FM, DAC_AM, PWM_RF, CAL_MARK from the MCU', [515, 366]],
['mcu', 'pwm', 'ctrl', [[150, 211], [150, 150], [170, 150]]],
['pwm', 'fmrf', 'ctrl', [[230, 128], [230, 106]], 'VT_RF', [236, 121, 'start']],
['vt', 'fmlo', 'ctrl', [[290, 203], [315, 203], [315, 153], [335, 153]]],
['vt', 'amlo', 'ctrl', [[290, 223], [322, 223], [322, 235], [335, 235]]],
['mcu', 'ant', 'ctrl', [[150, 372], [40, 372], [40, 230]]],
],
// relations that are not drawn as lines but light up together
links: [['band', 'fmrf'], ['band', 'fmlo'], ['band', 'fmmix'], ['band', 'amrf'], ['band', 'amlo'], ['band', 'ammix'], ['reg', 'usb']],
};
// Which flowchart node holds which drawn blocks (all 1:1 except the terminal "pc")
var NODE_BLOCK = { pc: null };
/* AM/FM circuit explorer: flowchart, station tuner, schematic viewer. Data: DESIGN, BLOCK_SRC (build.py),
SCH_BLOCKS (blocks/*.js), INFO / FLOW / ORDER / GROUPS (content.js), SCH (sch.js). */
(function () {
'use strict';
// Standalone, the explorer is the whole document. As the wiki widget (widget.js) it lives in a shadow root
// (EXPLORER_ROOT) under its custom element (EXPLORER_HOST), and the page's URL hash belongs to the wiki.
const ROOT = typeof EXPLORER_ROOT !== 'undefined' ? EXPLORER_ROOT : document;
const HOST = typeof EXPLORER_HOST !== 'undefined' ? EXPLORER_HOST : null;
const $ = (s, el) => (el || ROOT).querySelector(s);
const $$ = (s, el) => Array.from((el || ROOT).querySelectorAll(s));
// monochrome icons (currentColor), 24 x 24
const ICON = {
play: '<svg class="ico" viewBox="0 0 24 24" aria-hidden="true"><path d="M8 5.5v13l10.5-6.5z" fill="currentColor"/></svg>',
pause: '<svg class="ico" viewBox="0 0 24 24" aria-hidden="true"><path d="M7.5 5.5h3v13h-3zM13.5 5.5h3v13h-3z" fill="currentColor"/></svg>',
check: '<svg class="ico" viewBox="0 0 24 24" aria-hidden="true"><path d="M5 12.5l4.5 4.5L19 7.5" fill="none" stroke="currentColor" stroke-width="2.6" stroke-linecap="round" stroke-linejoin="round"/></svg>',
close: '<svg class="ico" viewBox="0 0 24 24" aria-hidden="true"><path d="M6.5 6.5l11 11M17.5 6.5l-11 11" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"/></svg>',
chev: '<svg class="ico chev" viewBox="0 0 24 24" aria-hidden="true"><path d="M9 6l6 6-6 6" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>',
};
const esc = (s) => String(s).replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"');
const SVGNS = 'http://www.w3.org/2000/svg';
// ------------------------------------------------------------ render every block once, index nets and parts
const BL = {}, R = {};
const netBlocks = {}, netPinBlocks = {}, partBlocks = {};
let nErr = 0, nWires = 0;
const drawnRefs = new Set();
for (const b of SCH_BLOCKS) {
BL[b.id] = b;
const r = SCH.render(b, DESIGN);
R[b.id] = r;
const A = r.analysis;
nErr += A.errors.length;
nWires += A.wires.length;
if (A.errors.length && window.console) console.warn(A.errors);
const add = (map, k) => { if (!k) return; (map[k] = map[k] || []); if (!map[k].includes(b.id)) map[k].push(b.id); };
for (const w of A.wires) add(netBlocks, A.netAt(w.pts[0]));
for (const a of A.anchors) add(netBlocks, a.name);
for (const p of A.parts) {
add(partBlocks, p.ref);
drawnRefs.add(p.ref);
for (const pin of Object.values(p.pins)) { add(netBlocks, pin.net); add(netPinBlocks, pin.net); }
}
}
const orderIdx = (id) => { const i = ORDER.indexOf(id); return i < 0 ? 99 : i; };
for (const m of [netBlocks, netPinBlocks, partBlocks]) for (const k in m) m[k].sort((a, b) => orderIdx(a) - orderIdx(b));
const homeBlock = (ref) => {
const p = DESIGN.parts[ref];
const list = partBlocks[ref] || [];
return p && list.includes(p.block) ? p.block : list[0];
};
const totalParts = Object.keys(DESIGN.parts).length;
const groundOnly = Object.keys(DESIGN.parts).filter((r) => !drawnRefs.has(r) && Object.values(DESIGN.parts[r].pins).every((n) => n === 'GND')).length;
$('#check').innerHTML = (nErr ? '' : ICON.check) + (nErr ? nErr + ' wiring errors' : 'Netlist-checked');
$('#check').classList.toggle('bad', !!nErr);
$('#check').title = (nErr ? '' : 'Every wire matches tools/design.py. ') + drawnRefs.size + ' of ' + totalParts + ' parts drawn' +
(groundOnly ? ' (the other ' + groundOnly + ' are ground-only machine pins)' : '') + ', ' + nWires + ' wires.';
// ------------------------------------------------------------ state
const S = { band: 'fm', mode: 'design', f: { fm: 101.1, am: 1010 }, sel: null, part: null, net: null, ctl: Object.assign({}, SPECTRUM.CTL0) };
const FM = { lo: [98.7, 118.7], boardLo: [91.5, 99.2], min: 87.5, max: 108, step: 0.1 };
const AM = { lo: [11.23, 12.4], boardLo: [9.547, 10.162], min: 530, max: 1700, step: 10 };
const IF1 = 10.695, LO2 = 10.240, IF2 = 0.455;
const AM_ONLY = ['amrf', 'amlo', 'ammix', 'amf', 'vga', 'det', 'agc'];
const FM_ONLY = ['fmrf', 'fmlo', 'fmmix', 'rssi', 'pump', 'fmaud', 'pwm'];
function plan(band, mode, f) {
// returns {rf, lo, side, image, ok, note} with frequencies in MHz
if (band === 'fm') {
const rf = f;
if (mode === 'design') {
const lo = rf + IF1;
return { rf, lo, side: 'above', image: rf + 2 * IF1, ok: lo >= FM.lo[0] - 1e-9 && lo <= FM.lo[1] + 1e-9 };
}
const hi = rf + IF1, low = rf - IF1;
if (hi <= FM.boardLo[1]) return { rf, lo: hi, side: 'above', image: rf + 2 * IF1, ok: hi >= FM.boardLo[0] };
if (low >= FM.boardLo[0] && low <= FM.boardLo[1]) return { rf, lo: low, side: 'below', image: rf - 2 * IF1, ok: true };
return { rf, lo: hi, alt: low, side: 'none', image: rf + 2 * IF1, ok: false };
}
const rf = f / 1000;
if (mode === 'design') {
const lo = rf + IF1;
return { rf, lo, side: 'above', image: rf + 2 * IF1, ok: lo >= AM.lo[0] - 1e-9 && lo <= AM.lo[1] + 1e-9 };
}
const lo = IF1 - rf; // the first board's AM VCO runs low: LO + RF = IF ("sum" mode)
return { rf, lo, side: 'sum', image: lo + IF1, ok: lo >= AM.boardLo[0] && lo <= AM.boardLo[1] };
}
const mhz = (v, d) => { const t = v.toFixed(d == null ? 3 : d); return t.indexOf('.') < 0 ? t : t.replace(/0+$/, '').replace(/\.$/, ''); };
const fmtF = (v) => (v < 2 ? mhz(v * 1000, 1) + ' kHz' : mhz(v) + ' MHz');
// ------------------------------------------------------------ block diagram (RF symbols, rfflow.js)
const flowSvg = $('#flow');
const mctx = () => {
const fmK = SPECTRUM.control(Object.assign({}, S, { band: 'fm' })), amK = SPECTRUM.control(Object.assign({}, S, { band: 'am' }));
return { band: S.band, ffm: S.f.fm, fam: S.f.am, mode: S.mode, fmP: fmK.P, amP: amK.P, fmK, amK };
};
function buildFlow() {
const c = mctx();
flowSvg.setAttribute('viewBox', '0 0 ' + RFFLOW.W + ' ' + RFFLOW.H);
flowSvg.innerHTML = RFFLOW.draw((id) => (MATH[id] ? MATH[id](c).flow : null), (id) => (INFO[id] ? INFO[id].group : 'dig'));
$$('.node[data-id]', flowSvg).forEach((g) => {
const id = g.dataset.id;
if (!INFO[id]) return;
g.addEventListener('click', () => select(id, { scroll: true }));
g.addEventListener('keydown', (ev) => { if (ev.key === 'Enter' || ev.key === ' ') { ev.preventDefault(); select(id, { scroll: true }); } });
g.addEventListener('mouseenter', (ev) => { relate(id, true); tipFlow(id, ev); });
g.addEventListener('mousemove', moveTip);
g.addEventListener('mouseleave', () => { relate(id, false); hideTip(); });
g.addEventListener('focus', () => relate(id, true));
g.addEventListener('blur', () => relate(id, false));
});
}
function tipFlow(id, ev) {
const m = MATH[id] && MATH[id](mctx());
const first = m && m.chain[0], last = m && (m.out || m.chain[m.chain.length - 1]);
const one = (e) => MATHFMT.html(e.split(/,\s{3}/)[0]);
tip.innerHTML = '<b>' + esc(INFO[id].title) + '</b>' + (m ? '<div class="td">In</div><div class="teq">' + one(first.eq) + '</div><div class="td">Out</div><div class="teq">' + one(last.eq) + '</div>' : '') +
'<div class="td hintline">Click for the schematic, the spectrum and the full math</div>';
tip.hidden = false; moveTip(ev);
}
function relate(id, on) {
const rel = new Set();
$$('.rfw', flowSvg).forEach((w) => {
const [a, b] = w.dataset.b.split(' ');
const hit = a === id || b === id;
if (hit) { rel.add(a); rel.add(b); }
w.classList.toggle('hot', on && hit);
});
rel.delete(id);
$$('.node[data-id]', flowSvg).forEach((n) => n.classList.toggle('rel', on && rel.has(n.dataset.id)));
}
function renderMath() {
const box = $('#mathbox');
if (!box) return;
if (!S.sel || !MATH[S.sel]) { box.innerHTML = ''; return; }
const m = MATH[S.sel](mctx());
const items = m.chain.concat(m.out ? [m.out] : []);
// one equation per line: the math strings join related equations with ', '
const eqs = (e) => e.split(/,\s{3}/).map((x) => '<div class="eq">' + MATHFMT.html(x) + '</div>').join('');
const note = (t) => (t ? '<p class="cnote">' + MATHFMT.html(t) + '</p>' : '');
// in the prose, single-letter variables with subscripts (R_E, g_m) are typeset; net names (VT_RF) are not
const prose = (t) => esc(t).replace(/(^|[^A-Za-z0-9+])([A-Za-zωβτ])_([A-Za-z0-9]+)\b/g, '$1<i>$2</i><sub>$3</sub>');
const DOM = { t: 'time domain', s: 's-domain', jw: 's = jω', z: 'z-domain', f: 'spectrum' };
let k = 0, dom = 't';
const li = items.map((it) => {
if (it.k !== 'op') return '<li class="c' + it.k + '"><span class="ctag">' + (it.k === 'in' ? 'In' : 'Out') + '</span><div class="ceq">' + eqs(it.eq) + '</div>' + note(it.note) + '</li>';
k++;
return '<li class="cop"><span class="cn">' + k + '</span><div class="chead"><span class="cname">' + esc(it.op) + '</span>' + (it.by ? '<span class="cby">' + esc(it.by) + '</span>' : '') +
(it.dom && (it.dom !== dom || k === 1) ? '<span class="cdom">' + (dom = it.dom, DOM[it.dom]) + '</span>' : '') + '</div><div class="ceq">' + eqs(it.eq) + '</div>' + note(it.note) + '</li>';
}).join('');
const drops = items.some((it) => /~~/.test(it.eq));
box.innerHTML = '<details class="fold mathfold"' + (S.mathOpen ? ' open' : '') + '><summary>' + ICON.chev + '<h3>The math</h3><span class="msub">In, ' + k + ' step' + (k === 1 ? '' : 's') + ', out</span></summary>' +
(drops ? '<p class="msub"><span class="drop">Struck-out</span> terms are near zero and dropped.</p>' : '') +
'<ol class="chain">' + li + '</ol>' +
(m.how ? '<details class="mhow"><summary>How the circuit does it</summary><p>' + prose(m.how) + '</p></details>' : '') + '</details>';
$('.mathfold', box).addEventListener('toggle', (ev) => { S.mathOpen = ev.currentTarget.open; });
}
function liveText(key) {
const c = mctx(), fp = c.fmP, ap = c.amP;
const r3 = (v) => (+v.toFixed(3)).toString();
switch (key) {
case 'fmRF': return S.f.fm.toFixed(1) + ' MHz';
case 'amRF': return S.f.am + ' kHz';
case 'fmLO': return fp.lo == null ? 'out of reach (first board)' : '= ' + r3(fp.lo) + ' MHz' + (fp.side === 'below' ? ' (below)' : '');
case 'fmIF': return fp.lo == null ? 'out of reach (first board)' : fp.side === 'below' ? 'here f_RF − f_LO = 10.695 MHz' : '= ' + r3(fp.lo) + ' − ' + S.f.fm.toFixed(1) + ' = 10.695 MHz';
case 'amLO': return '= ' + r3(ap.lo) + ' MHz' + (ap.ok ? '' : ' (out of reach)');
case 'amIF': return ap.side === 'sum' ? 'here f_LO + f_RF = 10.695 MHz' : '= ' + r3(ap.lo) + ' − ' + r3(S.f.am / 1000) + ' = 10.695 MHz';
case 'if2': return '= 10.695 − 10.240 = 0.455 MHz';
case 'pumpI': return '= 455 kHz × 88 pC = 40 µA';
default: return '';
}
}
function paintFlow() {
const off = new Set(S.band === 'fm' ? AM_ONLY : FM_ONLY);
$$('.node[data-id]', flowSvg).forEach((n) => {
const id = n.dataset.id;
n.classList.toggle('off', off.has(id));
n.classList.toggle('sel', id === S.sel);
const w = $('[data-warn]', n);
if (w) w.toggleAttribute('hidden', !(S.mode === 'board' && INFO[id] && INFO[id].board));
});
$$('.rfw', flowSvg).forEach((w) => {
const [a, b] = w.dataset.b.split(' ');
w.classList.toggle('off', off.has(a) || off.has(b));
});
$$('[data-live]', flowSvg).forEach((t) => { t.textContent = liveText(t.dataset.live); });
renderMath();
}
// ------------------------------------------------------------ tuner
const tuner = $('#tuner');
function setBand(b) {
S.band = b;
$$('#band button').forEach((x) => x.setAttribute('aria-pressed', String(x.dataset.band === b)));
tuner.classList.toggle('band-am', b === 'am');
const c = b === 'fm' ? FM : AM;
const r = $('#f-range');
r.min = c.min; r.max = c.max; r.step = c.step;
$('#f-unit').textContent = b === 'fm' ? 'MHz' : 'kHz';
$('#presets').innerHTML = (b === 'fm' ? [88.1, 98.1, 103.3, 106.7] : [600, 820, 1010, 1500])
.map((v) => '<button type="button" data-v="' + v + '">' + v + '</button>').join('');
setF(S.f[b]);
}
function setF(v) {
const c = S.band === 'fm' ? FM : AM;
v = Math.min(c.max, Math.max(c.min, Math.round(v / c.step) * c.step));
S.f[S.band] = +v.toFixed(1);
$('#f-range').value = S.f[S.band];
const inp = $('#f-in');
if (ROOT.activeElement !== inp) inp.value = S.band === 'fm' ? S.f.fm.toFixed(1) : String(S.f.am);
paintTuner();
paintFlow();
}
function paintTuner() {
const p0 = plan(S.band, S.mode, S.f[S.band]);
const K = SPECTRUM.control(S);
const p = Object.assign({}, p0, { lo: K.P.lo == null ? p0.lo : K.P.lo, tank: K.tank });
const fm = S.band === 'fm';
const rows = [
['rf', 'Station', fmtF(p.rf)],
['lo', 'Oscillator', K.P.lo == null ? '-' : mhz(K.P.lo) + ' MHz'],
['', 'IF', (K.if1 == null ? '-' : mhz(K.if1) + ' MHz') + ' \u2192 ' + (K.if2 == null ? '-' : mhz(K.if2 * 1000, 1) + ' kHz')],
];
$('#freqs').innerHTML = rows.map(([c, k, v]) => '<div class="freq ' + c + '"><div class="k">' + k + '</div><div class="v">' + v + '</div></div>').join('');
const v = $('#verdict');
let html;
const range = (a) => mhz(a[0], 2) + '-' + mhz(a[1], 2) + ' MHz';
if (S.mode === 'design') {
if (fm) {
html = 'The LO runs <b>10.695 MHz above</b> the station: ' + mhz(p.rf, 1) + ' + 10.695 = <b>' + mhz(p.lo) + ' MHz</b>. ' +
(p.ok ? 'That is inside the designed ' + range(FM.lo) + ' range. ' : '<b>That is outside the designed ' + range(FM.lo) + ' range.</b> ') + 'The RF amplifier\u2019s tank tracks the station.';
} else {
html = 'AM is converted <b>up</b>: LO = ' + mhz(p.rf * 1000, 0) + ' kHz + 10.695 MHz = <b>' + mhz(p.lo) + ' MHz</b>' +
(p.ok ? '' : ' (<b>outside the designed ' + range(AM.lo) + '</b>)') + '. The 2 MHz low-pass in front needs no tuning.';
}
} else if (fm) {
if (p.side === 'above') html = 'The first board’s LO reaches this one on the normal side: <b>' + mhz(p.lo) + ' MHz</b>, inside its measured ' + range(FM.boardLo) + '.';
else if (p.side === 'below') html = 'The first board’s LO only covers ' + range(FM.boardLo) + ', so it tunes this station from <b>below</b>: ' + mhz(p.rf, 1) + ' − 10.695 = <b>' + mhz(p.lo) + ' MHz</b>.';
else html = '<b>Out of reach on the first board.</b> The LO would need ' + mhz(p.lo) + ' or ' + mhz(p.alt) + ' MHz; it covers ' + range(FM.boardLo) + '. The board hears 87.5 to 88.5 and 102.2 to 108 MHz until the tank is retuned.';
if (p.side !== 'none') html += ' The RF tank is parked at PWM 2400 rather than tracking the station.';
} else {
html = p.ok
? 'The first board’s AM LO runs low (' + range(AM.boardLo) + '), so the firmware uses the mixer’s <b>sum</b>: LO = 10.695 − ' + mhz(p.rf, 3) + ' = <b>' + mhz(p.lo) + ' MHz</b>. Tuning works, but the AM IF strip passes no audio yet.'
: '<b>Out of reach on the first board.</b> Sum mode needs an LO of ' + mhz(p.lo) + ' MHz; the board covers ' + range(AM.boardLo) + ', which is about 533 to 1150 kHz.';
}
if (S.ctl.tune === 'dac' && K.P.lo != null) {
const off = Math.abs(K.if1 - 10.695) * 1000;
html = '<b>Manual DAC</b> (AFC off): code ' + K.dac + ' \u2192 VT ' + K.vt.toFixed(3) + ' V \u2192 LO <b>' + mhz(K.P.lo) + ' MHz</b>. Your station comes out at ' + mhz(K.if1) + ' MHz, <b>' + off.toFixed(off < 10 ? 1 : 0) + ' kHz</b> from the 10.695 MHz centre' +
(off < 1 ? ': centred.' : off < 90 ? ': on the slope of the 10.7 MHz filters.' : ': outside the filters, so it is cut.');
p.ok = off < 90;
}
v.innerHTML = html;
v.classList.toggle('bad', !p.ok);
drawSpectrum(p);
scheduleStages();
}
function drawSpectrum(p) {
const fm = S.band === 'fm';
const W = 640, X0 = 34, X1 = 620, YT = 22, YB = 108;
const lo = fm ? 60 : 0, hi = fm ? 140 : 25;
const sx = (f) => X0 + (f - lo) / (hi - lo) * (X1 - X0);
const sy = (a) => YB - a * (YB - YT - 14);
const o = [];
const band = fm ? [87.5, 108] : [0.53, 1.7];
o.push('<rect class="bandfill" x="' + sx(band[0]) + '" y="' + YT + '" width="' + (sx(band[1]) - sx(band[0])) + '" height="' + (YB - YT) + '"/>');
o.push('<text x="' + (sx(band[0]) + 3) + '" y="' + (YT + 10) + '">' + (fm ? 'FM band' : 'AM') + '</text>');
// filter response: tracking tank (FM, design) or the fixed 2 MHz low-pass (AM)
const curve = [];
if (fm) {
const Q = 12, f0 = p.tank || p.rf;
for (let f = lo; f <= hi; f += 0.25) { const x = f / f0 - f0 / f; curve.push([sx(f), sy(1 / Math.sqrt(1 + Q * Q * x * x))]); }
} else if (!fm) {
for (let f = 0.01; f <= hi; f += 0.05) curve.push([sx(f), sy(1 / Math.sqrt(1 + Math.pow(f / 2, 10)))]);
}
if (curve.length) {
o.push('<path class="resp" d="M' + curve[0][0] + ',' + YB + 'L' + curve.map((c) => c.join(',')).join('L') + 'L' + curve[curve.length - 1][0] + ',' + YB + 'Z"/>');
const lab = fm ? 'RF tank (tracks the station)' : '2 MHz low-pass';
o.push('<text x="' + (fm ? sx(p.rf) - 8 : sx(2.2)) + '" y="' + (fm ? YT + 30 : YT + 30) + '" text-anchor="' + (fm ? 'end' : 'start') + '">' + lab + '</text>');
}
// axis
o.push('<line class="axis" x1="' + X0 + '" x2="' + X1 + '" y1="' + YB + '" y2="' + YB + '"/>');
const ticks = fm ? [60, 70, 80, 90, 100, 110, 120, 130, 140] : [0, 5, 10, 15, 20, 25];
ticks.forEach((t, k) => {
const last = k === ticks.length - 1;
o.push('<line class="tick" x1="' + sx(t) + '" x2="' + sx(t) + '" y1="' + YB + '" y2="' + (YB + 4) + '"/><text x="' + (sx(t) + (last ? 4 : 0)) + '" y="' + (YB + 14) + '" text-anchor="' + (last ? 'end' : 'middle') + '">' + t + (last ? ' MHz' : '') + '</text>');
});
// LO range bar
const lr = fm ? (S.mode === 'design' ? FM.lo : FM.boardLo) : (S.mode === 'design' ? AM.lo : AM.boardLo);
o.push('<rect class="lorange" x="' + sx(lr[0]) + '" y="' + (YB + 20) + '" width="' + Math.max(2, sx(lr[1]) - sx(lr[0])) + '" height="7" rx="2"/>');
o.push('<text x="' + (sx(lr[1]) + 5) + '" y="' + (YB + 27) + '">LO range' + (S.mode === 'board' ? ', first board' : '') + '</text>');
// markers
const mk = (f, cls, lab, row) => {
if (f < lo || f > hi) return;
o.push('<line class="' + cls + '" x1="' + sx(f) + '" x2="' + sx(f) + '" y1="' + (YT + 4) + '" y2="' + YB + '"/>');
o.push('<text class="lbl-' + cls.slice(2) + '" x="' + sx(f) + '" y="' + (YT - 4 - row * 0) + '" text-anchor="middle">' + lab + '</text>');
};
mk(p.rf, 'm-rf', fm ? 'station' : 'stn', 0);
mk(p.lo, 'm-lo', 'LO', 0);
$('#spec').innerHTML = o.join('');
$('#spec').setAttribute('viewBox', '0 0 ' + W + ' 140');
}
// ------------------------------------------------------------ detail view
const view = $('#sch-view');
let vb = null, vbFit = null;
function select(id, opt) {
opt = opt || {};
if (!INFO[id] || !BL[id]) return;
S.sel = id; S.part = null; S.net = null;
const info = INFO[id], b = BL[id];
$('#d-title').textContent = info.title;
const src = BLOCK_SRC[id];
const chips = ['<span class="chip ' + info.group + '">' + GROUPS[info.group].name + '</span>'];
for (const bd of info.bands) if (bd !== info.group) chips.push('<span class="chip ' + bd + '">' + bd.toUpperCase() + '</span>');
if (info.bands.length === 2 && info.group !== 'if' && info.group !== 'dig' && info.group !== 'ctrl') chips.push('<span class="chip if">both bands</span>');
$('#d-title').title = src ? 'Drawn from tools/design.py, lines ' + src[0] + ' to ' + src[1] : '';
$('#d-chips').innerHTML = chips.join('');
const i = ORDER.indexOf(id);
$('#prev').disabled = i <= 0; $('#next').disabled = i >= ORDER.length - 1;
$('#prev').dataset.go = ORDER[i - 1] || ''; $('#next').dataset.go = ORDER[i + 1] || '';
$('#prev').title = i > 0 ? INFO[ORDER[i - 1]].title : ''; $('#next').title = i < ORDER.length - 1 ? INFO[ORDER[i + 1]].title : '';
// schematic
view.innerHTML = R[id].svg;
const svg = $('svg', view);
svg.removeAttribute('width'); svg.removeAttribute('height');
vbFit = [-16, -16, b.w + 32, b.h + 32];
vb = vbFit.slice();
applyVB();
wireSchematic(svg);
// info column
const facts = info.facts && info.facts.length ? '<div><h3>Key numbers</h3><ul class="facts">' + info.facts.map((f) => '<li>' + f + '</li>').join('') + '</ul></div>' : '';
const board = info.board ? '<div class="board"><h3>' + (info.boardTitle || (id === 'fmmix' || id === 'xo' ? 'From the RF review' : 'On the first board')) + '</h3><p>' + info.board + '</p></div>' : '';
const parts = R[id].analysis.parts.map((p) => p.ref).filter((r, k, a) => a.indexOf(r) === k);
parts.sort((a, b2) => sortRef(a) - sortRef(b2) || a.localeCompare(b2));
const rows = parts.map((r) => {
const d = DESIGN.parts[r];
const isTp = /^(TP|MC|MP)/.test(r);
return '<tr data-ref="' + r + '"><td>' + r + '</td><td>' + esc(isTp ? d.value : d.value) + '</td><td>' + esc(isTp ? (r.startsWith('TP') ? 'test pad on ' : 'machine contact on ') + (Object.values(d.pins)[0] || '') : d.desc) + '</td></tr>';
}).join('');
const more = info.text.slice(1);
$('#info').innerHTML = '<p class="role">' + info.role + '</p><div class="text">' + (info.text[0] ? '<p>' + info.text[0] + '</p>' : '') + '</div>' +
(more.length ? '<details class="fold more"><summary>' + ICON.chev + 'More about this block</summary><div class="text">' + more.map((t) => '<p>' + t + '</p>').join('') + '</div></details>' : '') +
board + facts + '<div id="card-slot"></div>' +
'<details class="fold partsbox"><summary>' + ICON.chev + 'Parts in this drawing (' + parts.length + ')</summary><div class="parts-wrap"><table class="parts"><tbody>' + rows + '</tbody></table></div></details>';
$$('.parts tr', $('#info')).forEach((tr) => {
tr.addEventListener('mouseenter', () => hotPart(tr.dataset.ref, true));
tr.addEventListener('mouseleave', () => hotPart(tr.dataset.ref, false));
tr.addEventListener('click', () => showPart(tr.dataset.ref));
});
paintFlow();
if (opt.stage) SD.stage = opt.stage;
SD.anim = null;
renderCtxCtl(id);
renderDetailChart();
if (!HOST) try { history.replaceState(null, '', '#' + id); } catch (e) { /* sandboxed */ }
if (opt.scroll) {
const r = $('#detail').getBoundingClientRect();
if (window.__amfmExplorerScroll) window.__amfmExplorerScroll($('#detail'), true);
else if (r.top > window.innerHeight * 0.6 || r.bottom < 80) $('#detail').scrollIntoView({ behavior: matchMedia('(prefers-reduced-motion: reduce)').matches ? 'auto' : 'smooth', block: 'start' });
}
}
function sortRef(r) {
const m = r.match(/^([A-Z]+)(\d+)/);
const pri = { Q: 0, U: 1, J: 2, Y: 3, FL: 4, D: 5, L: 6, C: 7, R: 8, F: 9, FB: 9, TP: 10, MC: 11, MP: 12 };
return m ? (pri[m[1]] != null ? pri[m[1]] : 9) * 10000 + +m[2] : 999999;
}
function applyVB() {
const svg = $('svg', view);
if (svg) svg.setAttribute('viewBox', vb.map((v) => Math.round(v * 10) / 10).join(' '));
}
function zoom(f, cx, cy) {
const [x, y, w, h] = vb;
const nw = Math.min(vbFit[2] * 1.2, Math.max(vbFit[2] / 6, w / f));
const k = nw / w;
cx = cx == null ? x + w / 2 : cx; cy = cy == null ? y + h / 2 : cy;
vb = [cx - (cx - x) * k, cy - (cy - y) * k, w * k, h * k];
applyVB();
}
$('#z-in').addEventListener('click', () => zoom(1.4));
$('#z-out').addEventListener('click', () => zoom(1 / 1.4));
$('#z-fit').addEventListener('click', () => { vb = vbFit.slice(); applyVB(); });
view.addEventListener('wheel', (ev) => {
if (!ev.ctrlKey && !ev.metaKey) return;
ev.preventDefault();
const svg = $('svg', view), r = svg.getBoundingClientRect();
const cx = vb[0] + (ev.clientX - r.left) / r.width * vb[2], cy = vb[1] + (ev.clientY - r.top) / r.height * vb[3];
zoom(ev.deltaY < 0 ? 1.15 : 1 / 1.15, cx, cy);
}, { passive: false });
let drag = null;
view.addEventListener('pointerdown', (ev) => {
if (ev.target.closest('.part, .flag')) return;
drag = { x: ev.clientX, y: ev.clientY, vb: vb.slice(), moved: false };
view.setPointerCapture(ev.pointerId);
});
view.addEventListener('pointermove', (ev) => {
if (!drag) return;
const svg = $('svg', view), r = svg.getBoundingClientRect();
const dx = (ev.clientX - drag.x) / r.width * vb[2], dy = (ev.clientY - drag.y) / r.height * vb[3];
if (Math.abs(ev.clientX - drag.x) + Math.abs(ev.clientY - drag.y) > 3) { drag.moved = true; view.classList.add('dragging'); hideTip(); }
if (drag.moved) { vb = [drag.vb[0] - dx, drag.vb[1] - dy, vb[2], vb[3]]; applyVB(); }
});
const endDrag = () => { if (drag) { view.classList.remove('dragging'); setTimeout(() => { drag = null; }, 0); } };
view.addEventListener('pointerup', endDrag);
view.addEventListener('pointercancel', endDrag);
function wireSchematic(svg) {
$$('.part', svg).forEach((g) => {
g.addEventListener('mouseenter', (ev) => { hotPart(g.dataset.ref, true); tipPart(g.dataset.ref, ev); });
g.addEventListener('mousemove', moveTip);
g.addEventListener('mouseleave', () => { hotPart(g.dataset.ref, false); hideTip(); });
g.addEventListener('click', () => { if (!drag || !drag.moved) showPart(g.dataset.ref); });
});
$$('[data-net]', svg).forEach((el) => {
const net = el.dataset.net;
if (!net) return;
el.addEventListener('mouseenter', (ev) => { hlNet(net, true); tipNet(net, ev, el.classList.contains('flag')); });
el.addEventListener('mousemove', moveTip);
el.addEventListener('mouseleave', () => { hlNet(net, false); hideTip(); });
if (el.classList.contains('flag')) {
el.addEventListener('click', (ev) => { if (!drag || !drag.moved) followNet(net, ev); });
el.addEventListener('keydown', (ev) => { if (ev.key === 'Enter' || ev.key === ' ') { ev.preventDefault(); followNet(net, ev); } });
} else {
el.addEventListener('click', () => { if (!drag || !drag.moved) { S.net = S.net === net ? null : net; hlNet(net, true); } });
}
});
}
function hotPart(ref, on) {
$$('.part[data-ref="' + ref + '"]', view).forEach((g) => g.classList.toggle('hot', on || S.part === ref));
$$('.parts tr[data-ref="' + ref + '"]').forEach((tr) => tr.classList.toggle('hot', on || S.part === ref));
}
function hlNet(net, on) {
$$('[data-net]', view).forEach((el) => {
const match = el.dataset.net === net && on;
el.classList.toggle('hl', match || (S.net != null && el.dataset.net === S.net));
});
}
// ------------------------------------------------------------ tooltip, menus, part card
const tip = $('#tip');
function moveTip(ev) {
const pad = 14, w = tip.offsetWidth, h = tip.offsetHeight;
let x = ev.clientX + pad, y = ev.clientY + pad;
if (x + w > window.innerWidth - 8) x = ev.clientX - w - pad;
if (y + h > window.innerHeight - 8) y = ev.clientY - h - pad;
tip.style.left = Math.max(4, x) + 'px'; tip.style.top = Math.max(4, y) + 'px';
}
function hideTip() { tip.hidden = true; }
function tipPart(ref, ev) {
const d = DESIGN.parts[ref];
if (!d) return;
const kind = ref.startsWith('TP') ? 'Test pad, silk label ' + d.value : ref.startsWith('MC') ? 'Machine contact, silk label ' + d.value : d.desc;
tip.innerHTML = '<b>' + esc(ref) + '</b> <span class="tv">' + esc(ref.match(/^(TP|MC)/) ? Object.values(d.pins)[0] : d.value) + '</span><div class="td">' + esc(kind) + '</div>' +
(d.mpn || d.lcsc ? '<div class="tv">' + esc([d.mpn, d.lcsc].filter(Boolean).join(' · ')) + '</div>' : '');
tip.hidden = false; moveTip(ev);
}
const blockName = (id) => (INFO[id] ? INFO[id].title : id);
function tipNet(net, ev, isFlag) {
const others = (netPinBlocks[net] || netBlocks[net] || []).filter((x) => x !== S.sel);
const pads = Object.entries(DESIGN.parts).filter(([r, p]) => /^(TP|MC)/.test(r) && Object.values(p.pins)[0] === net).map(([r, p]) => p.value + ' (' + r + ')');
tip.innerHTML = '<b>' + esc(net) + '</b>' + (others.length ? '<div class="td">' + (isFlag ? 'Click to go to ' : 'Also in ') + others.map(blockName).map(esc).join(', ') + '</div>' : '') +
(pads.length ? '<div class="tv">Probe: ' + esc(pads.join(', ')) + '</div>' : '');
tip.hidden = false; moveTip(ev);
}
const menu = $('#menu');
function closeMenu() { menu.hidden = true; }
document.addEventListener('click', (ev) => { if (!menu.hidden && !ev.composedPath().some((n) => n === menu || (n.classList && n.classList.contains('flag')))) closeMenu(); });
document.addEventListener('keydown', (ev) => { if (ev.key === 'Escape') { closeMenu(); hideTip(); } });
function followNet(net, ev) {
hideTip();
let others = (netPinBlocks[net] || []).filter((x) => x !== S.sel && INFO[x]);
if (!others.length) others = (netBlocks[net] || []).filter((x) => x !== S.sel && INFO[x]);
if (!others.length) return;
const go = (id) => { closeMenu(); select(id); setTimeout(() => { S.net = net; hlNet(net, true); }, 0); };
if (others.length === 1) return go(others[0]);
menu.innerHTML = '<div class="mh">' + esc(net) + ' continues in</div>' + others.map((id) => '<button type="button" data-go="' + id + '">' + esc(blockName(id)) + '</button>').join('');
$$('button', menu).forEach((b) => b.addEventListener('click', () => go(b.dataset.go)));
menu.hidden = false;
const x = Math.min(window.innerWidth - menu.offsetWidth - 8, (ev.clientX || 100) + 6);
const y = Math.min(window.innerHeight - menu.offsetHeight - 8, (ev.clientY || 100) + 6);
menu.style.left = x + 'px'; menu.style.top = y + 'px';
$('button', menu).focus();
}
function showPart(ref) {
const prev = S.part;
S.part = ref;
if (prev) hotPart(prev, false);
hotPart(ref, true);
const d = DESIGN.parts[ref];
const slot = $('#card-slot');
if (!d || !slot) return;
const links = [];
if (d.wiki) links.push('<a href="' + esc(d.wiki) + '" target="_blank" rel="noopener">Wiki page</a>');
if (d.lcsc) links.push('<a href="https://www.lcsc.com/product-detail/' + esc(d.lcsc) + '.html" target="_blank" rel="noopener">LCSC ' + esc(d.lcsc) + '</a>');
const pins = Object.entries(d.pins).filter(([, n]) => n).map(([pin, n]) => '<button type="button" data-net="' + esc(n) + '" title="Show ' + esc(n) + '">' + esc(pin) + ': ' + esc(n) + '</button>').join('');
slot.innerHTML = '<div class="card"><div class="ct"><b>' + esc(ref) + '</b><button type="button" aria-label="Close" id="card-x">' + ICON.close + '</button></div>' +
'<div class="cv">' + esc(d.value) + (d.mpn && d.mpn !== d.value ? ' · ' + esc(d.mpn) : '') + '</div>' +
'<div class="cd">' + esc(d.desc) + '</div>' + (links.length ? '<div class="cl">' + links.join('') + '</div>' : '') +
'<div class="pins">' + pins + '</div></div>';
$('#card-x').addEventListener('click', () => { S.part = null; hotPart(ref, false); slot.innerHTML = ''; });
$$('.pins button', slot).forEach((b) => b.addEventListener('click', (ev) => {
const net = b.dataset.net;
if ((netBlocks[net] || []).includes(S.sel)) { S.net = net; hlNet(net, true); }
else followNet(net, ev);
}));
}
// ------------------------------------------------------------ find
$('#find').addEventListener('submit', (ev) => {
ev.preventDefault();
const q = $('#find-in').value.trim();
const msg = $('#find-msg');
msg.textContent = '';
if (!q) return;
const ref = q.toUpperCase();
if (DESIGN.parts[ref] && homeBlock(ref)) { select(homeBlock(ref)); showPart(ref); return; }
const net = Object.keys(netBlocks).find((n) => n.toUpperCase() === ref);
if (net) {
// open the block where the net has the most connections
const cands = netPinBlocks[net] || netBlocks[net];
const score = (id) => R[id].analysis.parts.reduce((n, p) => n + Object.values(p.pins).filter((x) => x.net === net).length, 0);
const id = cands.slice().sort((a, b2) => score(b2) - score(a) || orderIdx(a) - orderIdx(b2))[0];
select(id); S.net = net; hlNet(net, true); return;
}
msg.textContent = 'No part or net called ' + q;
});
const dl = $('#find-list');
dl.innerHTML = Object.keys(DESIGN.parts).filter((r) => partBlocks[r]).concat(Object.keys(netBlocks)).map((s) => '<option value="' + esc(s) + '">').join('');
// ------------------------------------------------------------ controls
$$('#band button').forEach((b) => b.addEventListener('click', () => setBand(b.dataset.band)));
$$('#mode button').forEach((b) => b.addEventListener('click', () => {
S.mode = b.dataset.mode;
$$('#mode button').forEach((x) => x.setAttribute('aria-pressed', String(x === b)));
paintTuner(); paintFlow();
}));
$('#f-range').addEventListener('input', (ev) => setF(+ev.target.value));
$('#f-in').addEventListener('change', (ev) => { const v = parseFloat(ev.target.value); if (isFinite(v)) setF(S.band === 'am' && v < 2 ? v * 1000 : v); });
$('#f-in').addEventListener('keydown', (ev) => { if (ev.key === 'Enter') ev.target.blur(); });
$('#f-in').addEventListener('blur', () => setF(S.f[S.band]));
$('#presets').addEventListener('click', (ev) => { const b = ev.target.closest('button'); if (b) setF(+b.dataset.v); });
$('#prev').addEventListener('click', (ev) => { if (ev.currentTarget.dataset.go) select(ev.currentTarget.dataset.go); });
$('#next').addEventListener('click', (ev) => { if (ev.currentTarget.dataset.go) select(ev.currentTarget.dataset.go); });
// in the wiki's readme frame the page scrolls, not the frame: readme.html supplies __amfmExplorerScroll(el, onlyIfHidden)
$('#to-flow').addEventListener('click', () => (window.__amfmExplorerScroll ? window.__amfmExplorerScroll($('#flow-panel'), false) : $('#flow-panel').scrollIntoView({ behavior: 'smooth', block: 'start' })));
// ------------------------------------------------------------ spectrum at each stage
let SPEC = null, stagesQueued = false;
function scheduleStages() {
if (stagesQueued) return;
stagesQueued = true;
requestAnimationFrame(() => { stagesQueued = false; renderStages(); });
}
function legendHtml(mixer) {
const items = [['sig-st', 'your station'], ['sig-sub', 'stereo pilot and subcarriers'], ['sig-other', 'other stations'], ['sig-img', 'calibration marker (when on)'],
['', 'spectrum: signals + noise', 'trace'], ['', 'into this stage', 'ghost'], ['', 'AM / FM broadcast band', 'band'], mixer ? ['text-2', 'box: the part magnified below', 'zoombox'] : ['text-2', 'stage gain (top panel)']];
return items.map(([v, t, k]) => '<span><i class="' + (k || '') + '" style="--sc:var(--' + (v || 'text-3') + ')"></i>' + esc(t) + '</span>').join('');
}
const sigLevel = (st, x) => x.db.toFixed(1) + ' ' + st.yUnit;
const sigFreq = (st, x) => SPECTRUM.fmtF(x.band ? (x.band[0] + x.band[1]) / 2 : x.f, st.ax.unit);
function stageTable(st) {
const rows = (st.out.sig || []).filter((x) => x.f >= st.ax.min && x.f <= st.ax.max).sort((a, b) => b.db - a.db).slice(0, 12);
if (!rows.length) return '';
return '<details><summary>Levels table</summary><table><thead><tr><th>Signal</th><th>Frequency</th><th>Level</th></tr></thead><tbody>' +
rows.map((x) => '<tr><td>' + esc(x.label) + '</td><td class="n">' + esc(sigFreq(st, x)) + '</td><td class="n">' + sigLevel(st, x) + '</td></tr>').join('') +
'</tbody></table></details>';
}
const capOf = (st) => (st.inp && st.strip ? st.strip + ' ' : '') + (st.cap || '');
function stageCard(st, i) {
return '<article class="stage" data-i="' + i + '"><header><span class="step">' + (i + 1) + '</span><div class="sh"><h3>' + esc(st.title) + '</h3><span class="parts">' + esc(st.parts) + '</span></div>' +
(st.est ? '<span class="est">gain estimated</span>' : '') + '<button type="button" class="open" data-block="' + esc(st.block) + '" data-st="' + esc(st.id) + '">Open with schematic</button></header>' +
(useScope(st) ? SCOPE.render(st, i) : SPECTRUM.render(st, i)) + (st.fault ? '<p class="sfault">' + esc(st.fault) + '</p>' : '') + (useScope(st) ? '<p class="cap">' + esc(SCOPE.caption(st)) + '</p>' : st.cap || st.inp ? '<p class="cap">' + esc(capOf(st)) + '</p>' : '') + stageTable(st) + '</article>';
}
function renderStages() {
SPEC = SPECTRUM.build(S);
const grid = $('#spec-grid');
grid.className = 'spec-grid band-' + S.band;
$('#view-spec').className = 'band-' + S.band;
grid.__stages = SPEC.stages;
const last = SPEC.stages[SPEC.stages.length - 1];
grid.innerHTML = SPEC.stages.map((st, i) => stageCard(st, i)).join('') +
(last && last.fault && SPEC.stages.length < 6 ? '<p class="spec-end">Nothing reaches the IF, so there is nothing to follow past this point.</p>' : '');
renderDetailChart();
applyPin();
}
// ------------------------------------------------------------ the big chart under the schematic
// Blocks that are not a stage of their own show the stage they serve.
const STAGE_FOR = {
fmlo: ['fmmix', 'The oscillator itself is one line at the LO frequency. Its job shows in the mixer, which moves every signal by the LO.'],
amlo: ['ammix', 'The oscillator itself is one line at the LO frequency. Its job shows in the mixer, which moves every signal by the LO.'],
xo: ['mix2', 'This crystal is the second mixer’s LO; this is what it does to the signal.'],
rssi: ['lim', 'RSSI_FM taps the first limiter stage; this is the limiter.'],
pwm: ['fmrf', 'VT_RF tunes the RF amplifier’s tank; this is that stage.'],
vt: ['@mix', 'VT_FM and VT_AM set the oscillators, and the oscillator decides where the mixer puts every signal.'],
band: ['@rf', 'The band switch powers this front end; this is its RF stage.'],
};
const SD = { stage: null, win: {}, pin: null, drag: null, width: 0, list: null, band: 'fm', dom: 'time' };
try { SD.dom = localStorage.getItem('amfm-explorer-dom') || 'time'; } catch (e) { /* no storage */ }
// From the limiter on, the signal is shown in time, as a scope on that node would show it (Spectrum switches back).
function useScope(st) { return SD.dom !== 'freq' && typeof SCOPE !== 'undefined' && SCOPE.has(st); }
function scopeLegend(st) {
const items = [['sig-st', 'the signal on that node', 'line']].concat(st && st.td && st.td.fault ? [['', 'what the design expects', 'ghost']] : []).concat([['text-2', 'switch point, rails and rest levels', 'ref']]);
return items.map(([v, t, k]) => '<span><i class="' + k + '" style="--sc:var(--' + (v || 'text-3') + ')"></i>' + esc(t) + '</span>').join('');
}
function chartFor(id) {
let target = id, note = '';
if (STAGE_FOR[id]) {
[target, note] = STAGE_FOR[id];
if (target === '@mix') target = S.band === 'fm' ? 'fmmix' : 'ammix';
if (target === '@rf') target = S.band === 'fm' ? 'fmrf' : 'amrf';
}
const find = (list) => list.map((st, i) => (st.block === target || st.id === target ? i : -1)).filter((i) => i >= 0);
let list = SPEC.stages, band = S.band, idx = find(list);
if (!idx.length) {
const ob = S.band === 'fm' ? 'am' : 'fm';
const other = SPECTRUM.build(Object.assign({}, S, { band: ob }));
const j = find(other.stages);
if (j.length) { list = other.stages; band = ob; idx = j; }
}
return { list, band, idx, note };
}
function renderDetailChart() {
const sec = $('#sd'), view = $('#sd-view');
if (!S.sel || !SPEC) return;
const C = chartFor(S.sel);
if (!C.idx.length) { sec.hidden = true; return; }
sec.hidden = false;
if (!C.idx.some((i) => C.list[i].id === SD.stage)) {
const anim = C.idx.find((i) => C.list[i].steps && C.list[i].steps.length);
SD.stage = C.list[anim != null ? anim : C.idx[0]].id;
}
SD.sibs = C.idx.map((i) => C.list[i]);
const i = C.list.findIndex((st) => st.id === SD.stage);
const st = C.list[i];
SD.list = C.list; SD.band = C.band;
$('#sd-title').innerHTML = 'The signal: ' + esc(st.title) + ' <span class="sd-n">stage ' + (i + 1) + ' of ' + C.list.length + '</span>';
$('#sd-tabs').innerHTML = C.idx.length > 1 ? C.idx.map((k) => '<button type="button" data-st="' + esc(C.list[k].id) + '" aria-pressed="' + (C.list[k].id === SD.stage) + '">' + esc(C.list[k].title) + '</button>').join('') : '';
const note = (C.note ? C.note + ' ' : '') + (C.band !== S.band ? 'Shown for the ' + C.band.toUpperCase() + ' band, because this block is not used on ' + S.band.toUpperCase() + '.' : '');
$('#sd-note').hidden = !note; $('#sd-note').textContent = note;
const width = Math.max(440, Math.floor(view.clientWidth || 720));
SD.width = width;
if (SD.anim && SD.anim.stage !== st.id) SD.anim = null;
view.__i = i;
drawChart(st, i, width);
view.className = 'sd-view band-' + C.band;
renderSteps(st);
const sc = useScope(st);
$('#sd-dom').hidden = typeof SCOPE === 'undefined' || !SCOPE.has(st);
$$('#sd-dom button').forEach((b) => b.setAttribute('aria-pressed', String(b.dataset.dom === (sc ? 'time' : 'freq'))));
$('.sd-bar .zoom').hidden = sc;
$('#sd-legend').className = 'sd-legend spec-legend band-' + C.band;
$('#sd-legend').innerHTML = sc ? scopeLegend(st) : legendHtml(!!st.inp);
view.__stages = C.list; view.__st = st;
$('#sd-cap').innerHTML = (st.fault ? '<p class="sfault">' + esc(st.fault) + '</p>' : '') + (sc ? '<p>' + esc(SCOPE.caption(st)) + '</p>' : st.cap || st.inp ? '<p>' + esc(capOf(st)) + '</p>' : '') +
(st.est ? '<p class="hint">The gain of this stage is an estimate from the component values; the design notes do not give it.</p>' : '');
$('#sz-fit').disabled = !SD.win[st.id];
applyPin();
renderFollow();
}
// draw just the chart (also each animation frame)
function drawChart(st, i, width) {
const view = $('#sd-view');
st = st || view.__st; i = i == null ? view.__i : i; width = width || SD.width;
if (!st) return;
const A = SD.anim && SD.anim.stage === st.id ? SD.anim : null;
const opt = { big: true, width, win: SD.win[st.id] || null, anim: A ? { k: A.k, t: A.t } : null };
view.__scope = useScope(st);
view.innerHTML = view.__scope ? SCOPE.render(st, i, opt) : SPECTRUM.render(st, i, opt);
view.__opt = opt;
if (SD.pin) applyPin();
}
// zoom: factor > 1 zooms in, about frequency fc (or the window centre)
function sdZoom(factor, fc) {
const st = $('#sd-view').__st;
if (!st) return;
const lg = st.ax.log, T = (v) => (lg ? Math.log10(v) : v), Ti = (v) => (lg ? Math.pow(10, v) : v);
const [a, b] = SD.win[st.id] || [st.ax.min, st.ax.max];
const BA = T(st.ax.min), BB = T(st.ax.max), A = T(a), B = T(b);
const c = fc == null ? (A + B) / 2 : T(fc);
const span = Math.max((BB - BA) / 400, Math.min(BB - BA, (B - A) / factor));
let lo = c - (c - A) * span / (B - A), hi = lo + span;
if (lo < BA) { lo = BA; hi = lo + span; }
if (hi > BB) { hi = BB; lo = hi - span; }
SD.win[st.id] = span >= (BB - BA) * 0.999 ? null : [Ti(lo), Ti(hi)];
renderDetailChart();
}
function sdZoomTo(s) {
const st = $('#sd-view').__st;
if (!st || !s) return;
const lo0 = s.band ? s.band[0] : s.f - Math.max(s.bw || 0, (st.ax.max - st.ax.min) / 60) * 2.5;
const hi0 = s.band ? s.band[1] : s.f + Math.max(s.bw || 0, (st.ax.max - st.ax.min) / 60) * 2.5;
let lo = Math.max(st.ax.min, lo0), hi = Math.min(st.ax.max, hi0);
if (st.ax.log && !s.band) { const k = 1 + Math.max(0.03, 3 * (s.bw || 0) / s.f); lo = Math.max(st.ax.min, s.f / k); hi = Math.min(st.ax.max, s.f * k); }
SD.win[st.id] = [lo, hi];
renderDetailChart();
}
$('#sz-in').addEventListener('click', () => sdZoom(1.6));
$('#sz-out').addEventListener('click', () => sdZoom(1 / 1.6));
$('#sz-fit').addEventListener('click', () => { const st = $('#sd-view').__st; if (st) { SD.win[st.id] = null; renderDetailChart(); } });
$('#sz-st').addEventListener('click', () => {
const st = $('#sd-view').__st;
if (!st) return;
const s = (st.out.sig || []).filter((x) => x.kind === 'station' && !x.harm && !x.dc).sort((a, b) => b.db - a.db)[0];
if (s) sdZoomTo(s);
});
$('#sd-dom').addEventListener('click', (ev) => {
const b = ev.target.closest('button[data-dom]');
if (!b) return;
SD.dom = b.dataset.dom;
try { localStorage.setItem('amfm-explorer-dom', SD.dom); } catch (e) { /* no storage */ }
SD.anim = null;
renderDetailChart();
scheduleStages();
});
$('#sd-tabs').addEventListener('click', (ev) => { const b = ev.target.closest('button'); if (b) { SD.stage = b.dataset.st; renderDetailChart(); } });
const sdView = $('#sd-view');
const vbX = (svg, clientX) => { const r = svg.getBoundingClientRect(); return (clientX - r.left) / r.width * svg.viewBox.baseVal.width; };
const vbY = (svg, clientY) => { const r = svg.getBoundingClientRect(); return (clientY - r.top) / r.height * svg.viewBox.baseVal.height; };
sdView.addEventListener('wheel', (ev) => {
if (!ev.ctrlKey && !ev.metaKey) return;
const svg = $('svg', sdView);
if (!svg || sdView.__scope) return;
ev.preventDefault();
sdZoom(ev.deltaY < 0 ? 1.25 : 1 / 1.25, SPECTRUM.fAt(sdView.__st, sdView.__opt, vbX(svg, ev.clientX)));
}, { passive: false });
sdView.addEventListener('pointerdown', (ev) => {
const svg = $('svg', sdView);
if (!svg || ev.button !== 0 || sdView.__scope) return;
SD.drag = { x: ev.clientX, win: SD.win[sdView.__st.id] || null, moved: false, id: ev.pointerId };
});
sdView.addEventListener('pointermove', (ev) => {
const d = SD.drag;
if (!d) return;
const st = sdView.__st, svg = $('svg', sdView);
if (!d.moved && Math.abs(ev.clientX - d.x) < 4) return;
if (!d.moved) { d.moved = true; sdView.setPointerCapture(d.id); sdView.classList.add('dragging'); hideTip(); }
const lay = SPECTRUM.layout(st, sdView.__opt), r = svg.getBoundingClientRect();
const dxv = (ev.clientX - d.x) / r.width * svg.viewBox.baseVal.width / (lay.R - lay.L);
const lgx = st.ax.log, T = (v) => (lgx ? Math.log10(v) : v), Ti = (v) => (lgx ? Math.pow(10, v) : v);
const [a, b] = d.win || [st.ax.min, st.ax.max];
const span = T(b) - T(a), BA = T(st.ax.min), BB = T(st.ax.max);
if (span >= BB - BA - 1e-12) return;
let lo = T(a) - dxv * span;
lo = Math.max(BA, Math.min(BB - span, lo));
SD.win[st.id] = [Ti(lo), Ti(lo + span)];
renderDetailChart();
});
const endSdDrag = () => { if (SD.drag) { const moved = SD.drag.moved; sdView.classList.remove('dragging'); setTimeout(() => { SD.drag = null; }, 0); return moved; } return false; };
sdView.addEventListener('pointerup', endSdDrag);
sdView.addEventListener('pointercancel', endSdDrag);
sdView.addEventListener('dblclick', (ev) => {
const svg = $('svg', sdView);
if (!svg || sdView.__scope) return;
const res = SPECTRUM.pick(sdView.__st, vbX(svg, ev.clientX), sdView.__opt, vbY(svg, ev.clientY));
if (res.panel === 'in') {
const out = res.sig && (sdView.__st.out.sig || []).find((x) => x.id === res.sig.id && !x.sum);
if (out) sdZoomTo(out);
return;
}
if (res.sig) sdZoomTo(res.sig); else sdZoom(2, res.f);
});
if (window.ResizeObserver) {
let rq = 0;
new ResizeObserver(() => {
const w = Math.floor(sdView.clientWidth);
if (!sdView.__st || Math.abs(w - SD.width) < 12) return;
cancelAnimationFrame(rq); rq = requestAnimationFrame(renderDetailChart);
}).observe(sdView);
}
// ------------------------------------------------------------ STM32 controls: what the firmware can set
const CTX = { ant: ['marker'], fmrf: ['pwm'], pwm: ['pwm'], fmlo: ['tune'], amlo: ['tune'], vt: ['tune'], fmmix: ['tune'], ammix: ['tune'], cf1: ['tune'], ifamp: ['tune'],
mix2: ['tune'], xo: ['tune'], lim: ['tune'], rssi: ['tune'], sq: ['tune'], pump: ['tune'], amf: ['tune'], vga: ['tune'], det: ['tune'], band: ['band'], ui: ['band'], mcu: ['dsp'], fmaud: ['dsp'], agc: ['dsp'], amrf: ['tune'] };
const seg = (key, opts) => '<div class="seg sm" data-seg="' + key + '">' + opts.map(([v, t]) => '<button type="button" data-ctl="' + key + '" data-v="' + v + '">' + t + '</button>').join('') + '</div>';
function ctlCard(key, sfx) {
const id = (k) => 'c-' + k + '-' + sfx;
const card = (title, pin, body) => '<div class="ccard" data-card="' + key + '"><div class="ch"><b>' + title + '</b><span class="pin">' + pin + '</span></div>' + body + '<p class="ro" data-ro="' + key + '"></p></div>';
if (key === 'tune') return card('Tuning DAC', '<span data-ro="tunePin"></span>',
seg('tune', [['station', 'Station + AFC'], ['dac', 'Manual DAC']]) +
'<label class="sl" for="' + id('dac') + '"><span>DAC code</span><input type="range" min="0" max="4095" step="1" id="' + id('dac') + '" data-ctl="dac"><output data-ro="dacv"></output></label>');
if (key === 'pwm') return card('RF tracking PWM', 'PB1 TIM3 → 2-pole RC → U202A ×1.45 → VT_RF',
seg('pwmMode', [['track', 'Track'], ['manual', 'Manual']]) +
'<label class="sl" for="' + id('pwm') + '"><span>PWM</span><input type="range" min="0" max="4096" step="1" id="' + id('pwm') + '" data-ctl="pwm"><output data-ro="pwmv"></output></label>');
if (key === 'marker') return card('Calibration marker', 'PA8 TIM1 → R317, C323 → antenna',
'<label class="ck" for="' + id('mk') + '"><input type="checkbox" id="' + id('mk') + '" data-ctl="marker"> Marker on</label>' +
'<label class="sl" for="' + id('mn') + '"><span>N</span><input type="range" min="4" max="100" step="1" id="' + id('mn') + '" data-ctl="markerN"><output data-ro="markerv"></output></label>');
if (key === 'band') return card('Band enables', 'PB8 FM_EN_N, PB9 AM_EN_N → Q201, Q202', seg('band', [['fm', 'FM'], ['am', 'AM']]));
return card('DSP', 'firmware, between the ADC and USB',
'<div class="ckrow"><label class="ck" for="' + id('no') + '"><input type="checkbox" id="' + id('no') + '" data-ctl="notch"> 19 kHz notch</label>' +
'<label class="ck" for="' + id('hu') + '"><input type="checkbox" id="' + id('hu') + '" data-ctl="hum"> Hum canceller</label>' +
'<label class="ck" for="' + id('mu') + '"><input type="checkbox" id="' + id('mu') + '" data-ctl="mute"> Mute</label></div>' +
'<div class="ckrow"><span class="lbl">Noise filter</span>' + seg('nf', [['off', 'Off'], ['auto', 'Auto'], ['strong', 'Strong']]) + '</div>' +
'<label class="sl" for="' + id('ga') + '"><span>Gain</span><input type="range" min="-20" max="12" step="1" id="' + id('ga') + '" data-ctl="gain"><output data-ro="gainv"></output></label>');
}
function renderCtlPanel() { $('#ctl-grid').innerHTML = ['tune', 'pwm', 'marker', 'band', 'dsp'].map((k) => ctlCard(k, 'g')).join(''); syncCtl(); }
function renderCtxCtl(id) {
const keys = CTX[id] || [];
$('#sd-ctl').innerHTML = keys.length ? '<details class="fold sdcfold"' + (S.ctlOpen ? ' open' : '') + '><summary>' + ICON.chev + 'STM32 controls for this stage</summary><div class="sdc-grid">' + keys.map((k) => ctlCard(k, 's')).join('') + '</div></details>' : '';
const f = $('.sdcfold', $('#sd-ctl'));
if (f) f.addEventListener('toggle', () => { S.ctlOpen = f.open; });
syncCtl();
}
function syncCtl() {
const K = SPECTRUM.control(S), c = S.ctl, fm = S.band === 'fm';
$$('[data-ctl]').forEach((el) => {
const key = el.dataset.ctl;
if (el.dataset.v != null) {
const cur = key === 'tune' ? c.tune : key === 'pwmMode' ? c.pwmMode : key === 'nf' ? c.nf : key === 'band' ? S.band : null;
el.setAttribute('aria-pressed', String(cur === el.dataset.v));
if (key === 'pwmMode') el.disabled = !fm;
return;
}
if (el.type === 'checkbox') { el.checked = !!c[key]; if (key === 'notch') el.disabled = !fm; return; }
if (ROOT.activeElement === el) return;
if (key === 'dac') el.value = K.dac == null ? c.dac : K.dac;
else if (key === 'pwm') { el.value = K.pwm; el.disabled = !fm; }
else el.value = c[key];
});
const r3 = (v) => (+v.toFixed(3)).toString();
const ro = {
tunePin: fm ? 'PA4 DAC1 → U201A ×1.45 → VT_FM' : 'PA5 DAC2 → U201B ×1.45 → VT_AM',
dacv: K.dac == null ? '-' : String(K.dac),
tune: K.dac == null ? 'No DAC code reaches this station on the first board.'
: 'Code ' + K.dac + ' → ' + K.vdac.toFixed(3) + ' V → ×1.45 → ' + (fm ? 'VT_FM ' : 'VT_AM ') + K.vt.toFixed(3) + ' V → LO ' + r3(K.P.lo) + ' MHz' + (S.mode === 'board' ? ' (the board’s calibration table)' : ' (varactor model)') +
'. IF counter (TIM2): ' + (K.if2 * 1000).toFixed(1) + ' kHz' + (c.tune === 'station' ? ', held on 455 kHz by the AFC.' : Math.abs(K.if2 - 0.455) < 0.0005 ? ', centred.' : ', ' + (Math.abs(K.if2 - 0.455) * 1000).toFixed(1) + ' kHz off centre: the AFC would pull it back.'),
pwmv: String(K.pwm),
pwm: fm ? 'PWM ' + K.pwm + ' / 4096 = ' + (K.pwm / 40.96).toFixed(1) + ' % duty → ' + (K.vtRf / 1.45).toFixed(2) + ' V → ×1.45 → VT_RF ' + K.vtRf.toFixed(2) + ' V → tank at ' + K.tank.toFixed(1) + ' MHz (model; its range is ' + K.tankRange[0].toFixed(0) + '-' + K.tankRange[1].toFixed(0) + ' MHz)' +
(c.pwmMode === 'track' ? (S.mode === 'board' ? ', where the first board’s firmware parks it.' : ', following your station.') : '.') : 'FM only: the AM front end has no tracking tank.',
markerv: String(c.markerN),
marker: (() => {
const f = 48 / c.markerN, f0 = fm ? S.f.fm : S.f.am / 1000, k = Math.max(1, Math.round(f0 / f));
return (c.marker ? '' : 'Off (PA8 idles low). When on: ') + '48 MHz / ' + c.markerN + ' = ' + r3(f) + ' MHz square wave; harmonic ' + k + ' at ' + r3(k * f) + ' MHz is ' + (Math.abs(k * f - f0) * 1000).toFixed(0) + ' kHz from your station.';
})(),
band: 'PB8 FM_EN_N ' + (fm ? 'low → FM front end powered' : 'high-Z → FM off') + '; PB9 AM_EN_N ' + (fm ? 'high-Z → AM off' : 'low → AM front end powered') + '. LED ' + (fm ? 'green (PB13)' : 'yellow (PB14)') + ' on.',
gainv: (c.gain > 0 ? '+' : '') + c.gain + ' dB',
dsp: 'FIR ÷4 always on; pilot notch ' + (fm ? (c.notch ? 'on' : 'off') : 'n/a on AM') + '; noise filter ' + c.nf + '; hum canceller ' + (c.hum ? 'on' : 'off') + '; gain ' + (c.gain > 0 ? '+' : '') + c.gain + ' dB' + (c.mute ? '; muted' : '') + '.',
};
$$('[data-ro]').forEach((el) => { if (ro[el.dataset.ro] != null) el.textContent = ro[el.dataset.ro]; });
}
function setCtl(key, val) {
if (key === 'band') { setBand(val); syncCtl(); return; }
const c = S.ctl;
if (key === 'tune') c.tune = val;
else if (key === 'pwmMode') c.pwmMode = val;
else if (key === 'nf') c.nf = val;
else if (key === 'dac') { c.dac = +val; c.tune = 'dac'; }
else if (key === 'pwm') { c.pwm = +val; c.pwmMode = 'manual'; }
else if (key === 'markerN') { c.markerN = +val; c.marker = true; }
else if (key === 'gain') c.gain = +val;
else c[key] = val;
if (key === 'tune' && val === 'dac') { const K = SPECTRUM.control(Object.assign({}, S, { ctl: Object.assign({}, c, { tune: 'station' }) })); if (K.dac != null) c.dac = K.dac; }
syncCtl();
paintTuner();
paintFlow();
}
ROOT.addEventListener('input', (ev) => { const el = ev.target; if (el.dataset && el.dataset.ctl && el.type === 'range') setCtl(el.dataset.ctl, el.value); });
ROOT.addEventListener('change', (ev) => { const el = ev.target; if (el.dataset && el.dataset.ctl && el.type === 'checkbox') setCtl(el.dataset.ctl, el.checked); });
ROOT.addEventListener('click', (ev) => { const b = ev.target.closest && ev.target.closest('button[data-ctl][data-v]'); if (b && !b.disabled) setCtl(b.dataset.ctl, b.dataset.v); });
// ------------------------------------------------------------ step player: each part of a stage, one at a time
const DUR = { in: 1500, filter: 2300, gain: 2000, convert: 1800, mix: 4200, out: 1800 };
const RM = window.matchMedia && matchMedia('(prefers-reduced-motion: reduce)').matches;
function renderSteps(st) {
const play = $('#sd-play');
play.hidden = false;
if (!st.steps || !st.steps.length) {
const other = (SD.sibs || []).find((x) => x !== st && x.steps && x.steps.length);
$('#sp-play').hidden = !other;
$('#sp-play').innerHTML = other ? ICON.play + 'Animate: ' + esc(other.title) : '';
$('#sp-play').dataset.go = other ? other.id : '';
$('#sd-steps').innerHTML = '<span class="nosteps">' + (other ? 'This is the band as it arrives, with nothing applied yet. The \u201c' + esc(other.title) + '\u201d tab steps through each part.' : S.mode === 'board' ? 'Nothing to step through: on the first board no signal reaches this stage.' : 'Nothing to step through at this stage.') + '</span>';
return;
}
$('#sp-play').hidden = false;
$('#sp-play').dataset.go = '';
const A = SD.anim && SD.anim.stage === st.id ? SD.anim : null;
$('#sd-steps').innerHTML = st.steps.map((x, k) => '<button type="button" data-k="' + k + '" aria-pressed="' + !!(A && A.k === k) + '"><span class="n">' + (k + 1) + '</span>' + esc(x.name) + '</button>').join('') +
'<button type="button" data-k="final" aria-pressed="' + !A + '"><span class="n">' + ICON.check + '</span>Result</button>';
$('#sp-play').innerHTML = A && A.playing ? ICON.pause + 'Pause' : ICON.play + 'Play the steps';
}
function frame(now) {
const A = SD.anim;
if (!A || !A.playing) return;
const st = $('#sd-view').__st;
if (!st || st.id !== A.stage || !st.steps) { SD.anim = null; return; }
const step = st.steps[A.k], dur = DUR[step.kind] || 2000;
let t = (now - A.t0) / dur;
if (t >= 1) {
A.k++; A.t0 = now; t = 0;
if (A.k >= st.steps.length) { SD.anim = null; renderDetailChart(); return; }
renderSteps(st);
}
A.t = RM ? 1 : t;
drawChart();
requestAnimationFrame(frame);
}
$('#sp-play').addEventListener('click', () => {
const go = $('#sp-play').dataset.go;
if (go) { SD.stage = go; SD.anim = { stage: go, k: 0, t: 0, t0: performance.now(), playing: true }; renderDetailChart(); requestAnimationFrame(frame); return; }
const st = $('#sd-view').__st;
if (!st || !st.steps) return;
if (SD.anim && SD.anim.stage === st.id && SD.anim.playing) { SD.anim.playing = false; renderSteps(st); return; }
const k = SD.anim && SD.anim.stage === st.id && SD.anim.k < st.steps.length - 1 && SD.anim.t < 1 ? SD.anim.k : 0;
SD.anim = { stage: st.id, k, t: 0, t0: performance.now(), playing: true };
renderSteps(st);
requestAnimationFrame(frame);
});
$('#sd-steps').addEventListener('click', (ev) => {
const b = ev.target.closest('button');
const st = $('#sd-view').__st;
if (!b || !st) return;
SD.anim = b.dataset.k === 'final' ? null : { stage: st.id, k: +b.dataset.k, t: 1, playing: false };
renderSteps(st);
drawChart();
});
// ------------------------------------------------------------ pin a signal and follow it through every stage
function applyPin() {
ROOT.querySelectorAll('svg.stg .sg.pin').forEach((e) => e.classList.remove('pin'));
ROOT.querySelectorAll('.spec-grid, .sd-view').forEach((g) => g.classList.toggle('pinned', !!SD.pin));
if (SD.pin) ROOT.querySelectorAll('svg.stg .sg[data-sid="' + SD.pin + '"]').forEach((e) => e.classList.add('pin'));
}
function renderFollow() {
const box = $('#sd-follow');
if (!SD.pin || !SD.list) { box.innerHTML = ''; return; }
const rows = [];
let label = '';
const first = SD.list[0] && (SD.list[0].out.sig || []).find((x) => x.id === SD.pin);
const pinKind = first ? first.kind : null;
SD.list.forEach((st, i) => {
// the product that carries the signal: same kind as where it started (a sum product on the first board's AM)
const s = (st.out.sig || []).filter((x) => x.id.split(':')[0] === SD.pin && !x.harm).sort((a, b) => (a.kind === pinKind ? 0 : 1) - (b.kind === pinKind ? 0 : 1) || (a.id === SD.pin ? 0 : 1) - (b.id === SD.pin ? 0 : 1) || (a.sum ? 1 : 0) - (b.sum ? 1 : 0) || b.db - a.db)[0];
if (s && !label) label = s.label;
rows.push('<tr data-st="' + esc(st.id) + '" data-block="' + esc(st.block) + '"' + (st.id === SD.stage ? ' class="cur"' : '') + ' tabindex="0"><td class="n">' + (i + 1) + '</td><td>' + esc(st.title) + '</td>' +
(s ? '<td class="n">' + esc(sigFreq(st, s)) + '</td><td class="n">' + sigLevel(st, s) + '</td>' : '<td class="n gone" colspan="2">' + (i ? 'gone (filtered out)' : '-') + '</td>') + '</tr>');
});
box.innerHTML = '<div class="follow"><div class="fh"><span><b>Following: ' + esc(label || SD.pin) + '</b> through every stage. Click a row to open that stage.</span><button type="button" id="unpin">Stop following</button></div>' +
'<div class="fwrap"><table><thead><tr><th class="n">#</th><th>Stage</th><th class="n">Frequency</th><th class="n">Level</th></tr></thead><tbody>' + rows.join('') + '</tbody></table></div></div>';
$('#unpin').addEventListener('click', () => { SD.pin = null; applyPin(); renderFollow(); });
$$('tr[data-st]', box).forEach((tr) => {
const go = () => { SD.stage = tr.dataset.st; if (tr.dataset.block !== S.sel) select(tr.dataset.block, { stage: tr.dataset.st }); else renderDetailChart(); };
tr.addEventListener('click', go);
tr.addEventListener('keydown', (ev) => { if (ev.key === 'Enter') go(); });
});
}
function pinAt(host, ev) {
const hov = ev.target.closest('.hov');
if (!hov) return;
const svg = hov.ownerSVGElement;
if (svg.classList.contains('scope')) return;
const st = host.__st || host.__stages[+hov.dataset.i];
const res = SPECTRUM.pick(st, vbX(svg, ev.clientX), host.__opt, vbY(svg, ev.clientY));
// clicking the same spot again steps through signals that share it, then stops following
const ids = [res.sig].concat(res.also || []).filter(Boolean).map((x) => x.id.split(':')[0]).filter((v, k, a) => a.indexOf(v) === k);
const at = ids.indexOf(SD.pin);
SD.pin = !ids.length ? null : at < 0 ? ids[0] : ids[at + 1] || null;
applyPin();
renderFollow();
}
sdView.addEventListener('click', (ev) => { if (SD.drag && SD.drag.moved) return; pinAt(sdView, ev); });
$('#spec-grid').addEventListener('click', (ev) => {
const b = ev.target.closest('.open');
if (b) { SD.stage = b.dataset.st; select(b.dataset.block, { scroll: true, stage: b.dataset.st }); return; }
if (ev.target.closest('.hov')) pinAt($('#spec-grid'), ev);
});
// ------------------------------------------------------------ hover readout, shared by both chart sizes
function hoverStage(ev) {
const hov = ev.target.closest('.hov');
const host = ev.target.closest('.spec-grid, .sd-view');
if (!hov || !host || (SD.drag && SD.drag.moved)) return;
const st = host.__st || host.__stages[+hov.dataset.i];
const svg = hov.ownerSVGElement;
if (svg.classList.contains('scope')) {
const r = SCOPE.pick(st, vbX(svg, ev.clientX), host.classList.contains('sd-view') ? host.__opt : null);
if (!r) return;
const xh = $('.xhair', svg);
xh.setAttribute('x1', r.x); xh.setAttribute('x2', r.x); xh.setAttribute('y1', r.y1); xh.setAttribute('y2', r.y2); xh.setAttribute('visibility', 'visible');
tip.textContent = '';
const add = (cls, text) => { const d = document.createElement('div'); d.className = cls; d.textContent = text; tip.appendChild(d); };
add('tval', 't = ' + (r.t < 10 ? r.t.toFixed(2) : r.t.toFixed(1)) + ' ' + r.unit);
for (const [name, val] of r.vals) add('td', name + ': ' + val);
tip.hidden = false; moveTip(ev);
return;
}
const res = SPECTRUM.pick(st, vbX(svg, ev.clientX), host.__opt, vbY(svg, ev.clientY));
const xh = $('.xhair', svg);
xh.setAttribute('x1', res.x); xh.setAttribute('x2', res.x); xh.setAttribute('y1', res.y1); xh.setAttribute('y2', res.y2); xh.setAttribute('visibility', 'visible');
const sid = res.sig ? res.sig.id.split(':')[0] : null;
ROOT.querySelectorAll('.spec-grid, .sd-view').forEach((g) => g.classList.toggle('focus', !!sid));
ROOT.querySelectorAll('svg.stg .sg.on').forEach((e) => e.classList.remove('on'));
if (sid) ROOT.querySelectorAll('svg.stg .sg[data-sid="' + sid + '"]').forEach((e) => e.classList.add('on'));
tip.textContent = '';
const row = (cls, text, key) => { const d = document.createElement('div'); d.className = cls; if (key) { const k = document.createElement('span'); k.className = 'tkey'; k.style.setProperty('--sc', 'var(--' + key + ')'); d.appendChild(k); } d.appendChild(document.createTextNode(text)); tip.appendChild(d); };
if (res.sig) {
const kindVar = { station: 'sig-' + (host.classList.contains('band-am') ? 'am' : 'fm'), image: 'sig-img', sub: 'sig-sub', other: 'sig-other' }[res.sig.kind];
row('tval', res.val.toFixed(1) + ' ' + st.yUnit);
row('trow', res.sig.label, kindVar);
if (res.panel === 'in') row('td', SPECTRUM.fmtF(res.f, res.unit) + (res.sig.from != null ? ': the ' + (res.sig.sum ? 'sum' : 'difference') + ' copy of ' + SPECTRUM.fmtF(res.sig.from, 'MHz') + (res.sig.sum ? ' (f + LO)' : ' (|f − LO|)') : ''));
else row('td', SPECTRUM.fmtF(res.f, st.ax.unit) + (res.sig.from != null ? ', from ' + SPECTRUM.fmtF(res.sig.from, res.sig.from < 2 ? 'kHz' : 'MHz') + ' at the stage input' : ''));
} else {
row('td', SPECTRUM.fmtF(res.f, res.unit || st.ax.unit));
}
if (res.gain != null) row('td', 'Stage gain here: ' + (res.gain >= 0 ? '+' : '−') + Math.abs(res.gain).toFixed(1) + ' dB');
if (res.floor != null && isFinite(res.floor)) row('td', 'Noise floor: ' + res.floor.toFixed(0) + ' ' + st.yUnit);
for (const a of res.also || []) row('td', 'Also here: ' + a.label + ', ' + a.db.toFixed(1) + ' ' + st.yUnit);
if (res.sig) row('td hintline', SD.pin === sid ? ((res.also || []).length ? 'Click to follow the next signal here' : 'Click to stop following') : 'Click to follow it through every stage');
tip.hidden = false; moveTip(ev);
}
function leaveStage(ev) {
const svg = ev.target.ownerSVGElement;
if (svg) { const xh = $('.xhair', svg); if (xh) xh.setAttribute('visibility', 'hidden'); }
ROOT.querySelectorAll('.spec-grid, .sd-view').forEach((g) => g.classList.remove('focus'));
ROOT.querySelectorAll('svg.stg .sg.on').forEach((e) => e.classList.remove('on'));
hideTip();
}
ROOT.addEventListener('pointermove', (ev) => { if (ev.target.classList && ev.target.classList.contains('hov')) hoverStage(ev); });
ROOT.addEventListener('pointerout', (ev) => { if (ev.target.classList && ev.target.classList.contains('hov')) leaveStage(ev); });
$('#spec-legend').innerHTML = legendHtml(false) + '<span>On mixer stages the top panel is everything the mixer makes on one wide axis (the input dashed, the LO, and the two copies at LO − f and LO + f); the bottom panel magnifies the boxed part around the IF.</span><span>From the limiter on, the cards show the signal over time, as a scope on that node would; the Waveform / Spectrum switch above the big chart under each schematic changes all of them.</span>';
$('#sd-legend').innerHTML = legendHtml();
// tabs
const TABS = ['flow', 'spec', 'ctl']; // block diagram, signal at each stage, STM32 controls
function showTab(which, persist) {
if (TABS.indexOf(which) < 0) which = 'flow';
TABS.forEach((t) => { $('#tab-' + t).setAttribute('aria-selected', String(t === which)); $('#view-' + t).hidden = t !== which; });
if (persist) { try { localStorage.setItem('amfm-explorer-tab', which); } catch (e) { /* no storage */ } }
}
TABS.forEach((t) => $('#tab-' + t).addEventListener('click', () => showTab(t, true)));
$$('.tabs [role=tab]').forEach((t) => t.addEventListener('keydown', (ev) => {
if (ev.key !== 'ArrowRight' && ev.key !== 'ArrowLeft') return;
const k = TABS.indexOf(t.id.slice(4)), o = $('#tab-' + TABS[(k + (ev.key === 'ArrowRight' ? 1 : TABS.length - 1)) % TABS.length]);
o.focus(); o.click();
}));
buildFlow();
const attr = (k) => (HOST && HOST.getAttribute(k)) || '';
if (attr('mode') === 'board') { const b = $('#mode button[data-mode="board"]'); if (b) b.click(); }
setBand(attr('band') === 'am' ? 'am' : 'fm');
let start = HOST ? attr('block') : (location.hash || '').slice(1);
let tab = 'flow';
try { tab = localStorage.getItem('amfm-explorer-tab') || 'flow'; } catch (e) { /* no storage */ }
if (start === 'spectrum' || attr('view') === 'stages') { tab = 'spec'; if (start === 'spectrum') start = 'ant'; }
if (attr('view') === 'controls') tab = 'ctl';
showTab(tab, false);
if (!INFO[start] || !BL[start]) start = 'ant';
renderCtlPanel();
renderStages();
select(start);
if (!HOST) window.addEventListener('hashchange', () => { const h = location.hash.slice(1); if (h !== S.sel && INFO[h] && BL[h]) select(h, { scroll: true }); });
// for the wiki's widget automation (window.__adomInlineWidgets): wait for it, read and set what it shows
if (HOST) HOST.adomDrive = {
ready: () => Promise.resolve(),
state: () => ({ state: S.sel, band: S.band, mode: S.mode, station: S.band === 'fm' ? S.f.fm : S.f.am, view: !$('#view-spec').hidden ? 'stages' : !$('#view-ctl').hidden ? 'controls' : 'diagram' }),
set: (v) => { v = String(v); if (v === 'fm' || v === 'am') { setBand(v); return Promise.resolve(true); } if (INFO[v] && BL[v]) { select(v, { scroll: true }); return Promise.resolve(true); } return Promise.resolve(false); },
};
})();
}
class AmfmExplorer extends HTMLElement {
connectedCallback() {
if (this._booted) return;
this._booted = true;
var root = this.shadowRoot || this.attachShadow({ mode: 'open' });
root.innerHTML = '<style>' + CSS + '</style>' + HTML;
try { boot(root, this); } catch (e) {
console.error('[adom-amfm-explorer]', e);
var p = document.createElement('p');
p.textContent = 'The circuit explorer could not start: ' + e.message;
p.style.cssText = 'color:#e6edf3;font:14px Satoshi,sans-serif;border:1px solid #30363d;border-radius:10px;padding:12px 14px';
root.innerHTML = ''; root.appendChild(p);
}
}
}
customElements.define('adom-amfm-explorer', AmfmExplorer);
})();
</script>
<script>
(function () {
'use strict';
// the wiki caps the frame at 32000 px: past the budget, close the biggest open sections (never one you opened)
var BUDGET = 30000, auto = new WeakSet(), mine = new WeakSet();
document.querySelectorAll('details.fold').forEach(function (d) {
d.addEventListener('toggle', function () { if (auto.has(d)) auto.delete(d); else mine.add(d); });
});
function fit() {
var root = document.documentElement;
if (root.scrollHeight <= BUDGET) return;
var open = Array.prototype.filter.call(document.querySelectorAll('details.fold[open]'), function (d) { return !mine.has(d); })
.sort(function (a, b) { return b.offsetHeight - a.offsetHeight; });
for (var i = 0; i < open.length && root.scrollHeight > BUDGET; i++) { auto.add(open[i]); open[i].open = false; }
}
// the frame grows to fit: tell the wiki page our height (readme-height contract)
var last = 0;
function report() {
fit();
var h = Math.ceil(document.documentElement.scrollHeight) + 2;
if (Math.abs(h - last) > 2) { last = h; parent.postMessage({ type: 'readme-height', height: h }, '*'); }
}
window.addEventListener('load', report);
if (window.ResizeObserver) new ResizeObserver(report).observe(document.documentElement);
setInterval(report, 1200);
report();
// the frame never scrolls, the wiki page does: ask it to bring an element's top into view
function scrollToEl(el) {
var f = el.closest && el.closest('details.fold');
if (f && !f.open) f.open = true;
var top = el.getBoundingClientRect().top + (window.scrollY || 0);
parent.postMessage({ type: 'readme-scroll-to', top: Math.max(0, Math.round(top) - 8) }, '*');
}
// the explorer calls this when a block opens (onlyIfHidden) or for its Flowchart button
window.__amfmExplorerScroll = function (el, onlyIfHidden) {
if (!onlyIfHidden || !window.IntersectionObserver) return scrollToEl(el);
var io = new IntersectionObserver(function (es) {
io.disconnect();
var e = es[0];
if (!e.isIntersecting || e.intersectionRect.height < 240) scrollToEl(el);
});
io.observe(el);
};
document.addEventListener('click', function (ev) {
var t = ev.target;
// links inside the page scroll the wiki page to the heading
var a = t.closest && t.closest('a[href^="#"]');
if (a) {
var id = decodeURIComponent(a.getAttribute('href').slice(1)), el = document.getElementById(id);
if (el) { ev.preventDefault(); scrollToEl(el); }
return;
}
// gallery images open in the wiki's lightbox
var img = t.closest && t.closest('img.zoom');
if (img) parent.postMessage({ type: 'readme-lightbox', src: img.currentSrc || img.src }, '*');
});
// the wiki page's #hash: a heading here, or one of the explorer's blocks (#lim, #pump, ...)
window.addEventListener('message', function (ev) {
var d = ev.data;
if (ev.source !== parent || !d || d.type !== 'readme-hash') return;
var h = decodeURIComponent(String(d.hash || '').replace(/^#/, ''));
if (!h) return;
var el = document.getElementById(h);
if (el) return scrollToEl(el);
var x = document.querySelector('adom-amfm-explorer');
if (x && x.adomDrive) x.adomDrive.set(h).then(function (ok) { if (ok) scrollToEl(x); });
});
})();
</script>
</body>
</html>