From f7d365a5d18a28e9ac6d639d6ef2531797b074b3 Mon Sep 17 00:00:00 2001 From: "guillaume.bonabau" Date: Mon, 18 Mar 2024 08:26:00 +0100 Subject: [PATCH 1/2] New signal, RoI and changed frequency --- frequencySpectrum.m | 5 ++++- main.m | 7 +++++-- unknownsignal.csv | 2 +- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/frequencySpectrum.m b/frequencySpectrum.m index aa6a16b..0abae9b 100644 --- a/frequencySpectrum.m +++ b/frequencySpectrum.m @@ -1,4 +1,4 @@ -function power = frequencySpectrum(signal, fs, resolution) +function power = frequencySpectrum(signal, fs, resolution,RoI) %%%%%%%%%%%%%%%%%% %function power = frequencySpectrum(signal, fs, pad) % @@ -8,6 +8,7 @@ function power = frequencySpectrum(signal, fs, resolution) % - signal: the input signal to process % - fs: the sampling rate in Hz % - resolution: frequency resolution in Hz, signal will be padded with zeros if necessary +% - RoI: region of interest % % Output: % - power: the power spectrum @@ -52,12 +53,14 @@ subplot(1,3,2) % linear frequency plot f = (0:n-1)*(fs/n); % frequency range plot(f,power, 'b*'); hold on; plot(f,power, 'r'); +xlim(RoI); title("Frequency Linear "); xlabel('Frequency (Hz)') ylabel('Power (a.u.)') subplot(1,3,3) % log frequency plot plot(f,10*log10(power/power(ind))); +xlim(RoI); title("Frequency Log"); xlabel('Frequency (Hz)') ylabel('Power (dB)') diff --git a/main.m b/main.m index 4192254..a6c7923 100644 --- a/main.m +++ b/main.m @@ -1,6 +1,6 @@ %%%%%%%%%%%%%%%%%%%%%% % UNKNOWN SIGNAL -% Sampling frequency: 300 Hz +% Sampling frequency: 200 Hz % Duration; 2 s % First second: 0.1Hz, 30 Hz, 30.5 Hz, 60 Hz, 61 Hz % Second second: 0.1Hz, 32 Hz, 36 Hz, 64 Hz, 72 Hz @@ -14,7 +14,7 @@ signal = csvread('unknownsignal.csv'); %%%%%SIGNAL CHARACTERISTICS%%%%% % sets sampling frequency -fps = 300; % -> freqMax of the signal should be < 150 Hz (Shannon-Nyquisit theorem), in practice freqMax < 60 Hz would be better +fps = 200; % -> freqMax of the signal should be < 150 Hz (Shannon-Nyquisit theorem), in practice freqMax < 60 Hz would be better % computes the duration of the signal duration = length(signal) / fps; % in s @@ -22,6 +22,9 @@ duration = length(signal) / fps; % in s % estimates its original frequency resolution resolution = fps / length(signal); % in Hz +%crop the Power spectrums over the region of interest +RoI=[5,20]; + %%%%%STATIONARITY%%%%% % temporal plot figure; diff --git a/unknownsignal.csv b/unknownsignal.csv index d7d30aa..878513e 100644 --- a/unknownsignal.csv +++ b/unknownsignal.csv @@ -1 +1 @@ --0.009348970882580864,0.09447038206807423,0.08360564219393768,-0.01879270263876013,-0.04336689922362995,0.0002123615596719688,0.05810591099805168,0.01298959956442462,-0.09567485254026505,-0.09043062273825084,0.01663625159423805,0.09403551698703372,0.07872521926457551,-0.008838167465359646,-0.05291951153636757,0.002690994207596069,0.04344001448717938,-0.01302836609516841,-0.1000922696888745,-0.08968021665074606,0.02933599208177537,0.09708298188456424,0.07762524282482781,-0.01774747916934274,-0.03535095523919493,0.01560509512408302,0.0526595943812137,-0.01757812813043225,-0.1009896324011899,-0.0861979848372649,0.02301182067820549,0.0979935479237323,0.0637895378625053,-0.03586097730485663,-0.03844910403533137,0.01532501750675468,0.05684438256702253,-0.01791541811146156,-0.09661133210108638,-0.07064987341789893,0.03349266857942304,0.09789754408546932,0.05913560616970621,-0.0289515353943101,-0.04005411585434029,0.01996242010414721,0.03710046628811902,-0.03149047983199348,-0.09462646722713429,-0.05111606570679347,0.04317872775782028,0.09173999490105442,0.05192080171031176,-0.03652752644140044,-0.03642245231076662,0.03416880536797962,0.04383687456466972,-0.02610315563618078,-0.08736219068747986,-0.04413038499821683,0.05236637106809727,0.1012053323982758,0.0293975929018478,-0.03321809256629487,-0.01547113064466566,0.02534800821301692,0.03221830630457975,-0.0300156936735816,-0.09112135290329169,-0.03901728770602989,0.05770806886459912,0.09600531813846822,0.03647716299990611,-0.02461317331076563,-0.02055414346183304,0.02807404673118331,0.02788093751079749,-0.03938817715469145,-0.08420092076288807,-0.02336605831535416,0.05671162204832503,0.08878439748964971,0.03480637171466403,-0.01630907778433605,-0.01727403774703194,0.02636237127917864,0.008009631237447211,-0.04582259258849582,-0.07949014997399727,-0.01669140231056547,0.0666427518143647,0.07007278710892109,0.01788916641123812,-0.009781760798607724,-0.006116188233797462,0.02270803262246281,0.006904744789195083,-0.04099685174333257,-0.06080384427016768,-0.001527801425840969,0.05634349802459131,0.06014971119859325,0.01862070701506952,-0.009915236686479596,-0.006835038997671079,0.02067589217461508,0.005200568600149268,-0.03830344602413359,-0.04240392594804745,-0.001873984569162453,0.06122765685594298,0.06279785339271958,0.01244891375222804,0.0005432291444109252,0.00968331755718895,0.007596048274396343,-0.007005762178695147,-0.05154368074743204,-0.03880114419601027,-0.004200406157086081,0.05220230648935797,0.04589480635683223,0.02573957284820802,0.001806323828660955,0.001432493320692435,0.004744781402980649,-0.01294567226681585,-0.04252621459368208,-0.01895131046245863,0.003169298537592379,0.03415654602135682,0.04517151503848332,0.01422565009763252,0.01632452184970179,0.009938947054480288,-0.003314344681133577,-0.01887915773658843,-0.03732793364717286,-0.01108244775416027,0.006364278330025284,0.02625881202590369,0.02882327517703433,0.0353328563847328,0.01282210525773145,0.01160488991984136,-0.01959022596084681,-0.02198988939280035,-0.01504339810564668,-0.0116700993761547,0.01096084599431798,0.0299151066154094,0.03645737293813073,0.03104188504351985,0.01421432559380683,0.004905348058083752,-0.01896779481630037,-0.03047610305023291,-0.02128664866055053,0.008897126877350172,0.0145744201653983,0.01195037139388165,0.03160984292170223,0.02941397595277374,0.02610832365181256,-0.01427950862006439,-0.02690294545104295,-0.01441723218365064,-0.00692701727444872,0.009171724782794457,0.008845868579492067,0.014629861411929,0.03396487508836295,0.04184811213410438,0.01995850452839146,-0.004592838293434293,-0.03384376704385147,-0.008986282245829121,0.01784766747192001,0.02014257653766106,0.01045296468069363,-0.005496123590575532,0.02299940272824242,0.05800183036391036,0.02894026404571843,-0.01845873596559511,-0.03099579409152962,-0.006878951359566719,0.02933095104895263,0.01638410377715318,-0.009898189367847747,-0.01073699833927705,0.04149081859648064,0.05077973589167468,0.03945523018983992,-0.02036004420726279,-0.0396627859103991,-0.009863570360462943,0.02946488643973951,0.01894768649822723,-0.01889147013472705,-0.00708467757755153,0.03662586455212558,0.07022038314255519,0.03428342715334518,-0.0323285156231326,-0.04132316528374965,0.008200816029244721,0.04129165308288449,0.02489650845560419,-0.03032295083018663,-0.01592513026384504,0.04467663013536802,0.0749917547414979,0.01818488394674796,-0.03242887359312312,-0.05582717171833845,0.01832926038917867,0.04208730869329054,0.01038444448613992,-0.02415890866726589,-0.01268149094860769,0.04098631621358722,0.08142428201509964,0.01662271796423621,-0.03899462893166734,-0.04751830832363121,0.03061081716001657,0.06531733812678729,0.01471174890491253,-0.02663261488417433,-0.01151220578309232,0.05748925241194372,0.08465089340046875,0.01934908352650085,-0.06348579767857832,-0.03475095964059048,0.02238726508932614,0.05773679632205703,0.01349223479728396,-0.03859579915517771,-0.01915759664761141,0.05635421957455599,0.08108272431095684,0.01390195696144454,-0.06251270278057168,-0.03746352198784021,0.041095291617814,0.06993100133299082,-0.003756618554697236,-0.04188964854075786,-0.01825357950686139,0.06987353110023554,0.07140633148504352,-0.006994144606631249,-0.06097944139987181,-0.03915315525595504,0.05515731565998416,0.07321767534505022,0.006015656766650739,-0.05796370160171109,-0.02118830844714229,0.06859478386459564,0.08032320958380992,-0.006079233632284301,-0.06743125733183766,-0.03215902337017505,0.07196755454754822,0.06527548822586982,-0.01916219939411995,-0.06750286467555459,-0.0003867439755802556,0.08804350634096808,0.076053154437773,-0.01790948144395956,-0.07332350319667899,-0.005249478697907707,0.06764651751886908,0.06744805004538577,-0.02039385553989215,-0.06699608503532894,0.000502348933432209,0.07406695645308535,0.07056776624237805,-0.01627960595131078,-0.0755683275202965,-0.008961663246916555,0.08673547746654241,0.06763999993638903,-0.01768702098823165,-0.06019034115918563,0.002059311667271519,0.09101434681850555,0.06749403634072583,-0.02130613798543037,-0.06442206001562192,0.001586912844806124,0.08738318519487351,0.0626252300474737,-0.0362099880355953,-0.05737456018706703,-0.01869794176516173,0.02590080742460926,0.0213762025577428,-0.03001566055610448,0.003564674300549736,0.008337059237029498,0.02395865313038071,-0.001410096962367942,-0.04513083838008348,0.006108722407566072,0.03874980949050297,0.000609450539897697,-0.0005075389591657938,0.01030045621608716,-0.002051485142892909,-0.008346895467293721,-0.02644458281998912,-0.03582607623666365,-0.02424192982942111,0.003179023503850416,0.03596596351396517,-0.0009597845228279268,0.01381068122960056,-0.001243113709745794,0.01956543583242304,0.009176486965252485,0.0007949585466153165,-0.03386678546516545,-0.02271184495807883,0.008847206980369764,0.01498559587459657,-0.01504059100704643,-0.01874731763798832,-0.01983659430483969,0.02719495919350769,-0.00801747903775249,-0.01143922799279427,-0.01660132007757344,0.02149478908485679,0.03188774393638444,-0.01240225188721136,-0.03105150411930327,0.01325416160149562,0.02361888789952988,-0.007758077633581757,-0.0381203304856572,-0.02992491189760543,0.005780514783921024,0.02458555443067304,0.02250444710772951,-0.01367540009031167,-0.01193617499536609,0.02465721206052532,-0.01097631870197657,-0.02973704756320626,-0.004246098988477233,0.01144957156251624,0.02867624589494001,0.02734731027515312,0.01964219683742284,-0.002733166177866031,0.01179914010575895,-0.009800866397498584,-0.004539288525545361,-0.005450698224377014,-0.03180751593518433,0.01202591385102059,0.05374212269586827,0.01149820378106473,-0.01373098097959682,-0.008223109337570911,0.03295999727812463,0.02497655105820617,-0.01743791454277627,-0.04593412595780568,0.001303675409024889,0.05349947612798771,0.03279539590749408,-0.02256111326239454,-0.003058271083686935,0.01519093512547585,0.03344049455095777,-0.002085789652093582,-0.01878083949817667,-0.01678330965365802,0.02872730664736065,0.01252346575483868,-0.0004333586394085322,-0.02187605123669452,0.009528615512461414,0.02645598850586843,-0.01023940643947138,-0.0261179930606175,0.006285379054716491,0.004626241030084828,0.02091299604752551,0.02191307093855238,0.01216972452352365,-0.00734090984799023,0.01688000564471545,0.0132659678165392,-0.009286545002932097,-0.02493703566145453,-0.006782607638065848,0.01037901687846048,0.03750908580600581,0.0171945437158521,-0.005697210608720011,0.01908588292818939,0.02551411853821111,0.02388787238396618,-0.01601763892291455,-0.03363167433301847,0.03595570626580046,0.04869197261486143,-0.00775878446978746,-0.01368498306012017,-0.01332251949826048,0.03003865889095055,-0.01048053121969781,-0.01523553046695153,-0.02409843073418234,0.02596718299837635,0.02728760131137762,0.00158578563479334,-0.005710039082370692,0.009613206942895459,0.004871826262008799,0.02742848837121559,-0.01994832639410472,-0.02771703134878183,0.002990179949445167,-0.002829563398799584,0.03823848504358769,0.02359337112272381,-0.002785649656705466,0.0005479406800780463,-0.002049909909139239,0.02390342377960694,-0.02196888900606388,-0.03638705146305336,-0.009380065303996826,0.05394050467664113,0.02109882431787045,0.008422325460586542,-0.02796897404974929,0.01821271690720619,0.03405921520675589,-0.02208620251545578,-0.0303535413820789,0.01364987334332244,0.04860392856668443,0.02534665875948846,-0.02097876239657486,0.001891653662702836,0.01838329324473817,0.003116603873008342,-0.03130458592580143,-0.008840729843955702,0.01495760989888319,0.02088569779950408,0.02667196493038033,-0.01458764868909556,0.002073079400912294,-0.008324353649718817,0.009011556114273261,0.01106938559669092,-0.02093907590972575,-0.001267877942320625,0.01995480420791863,0.03468820079790556,0.02896299822989131,-0.000676673348678959,-0.02019712410851976,0.01734682310760144,0.01244239401079844,0.02065610099703078,0.002192320168276155,0.007800598736580336,0.04863461273895345,0.02022708616391412,-0.01059860563687298,-0.002294822484683724,0.004817081656407436,0.02747963826476045,0.0233182420673558,-0.01254265847220803,0.005610013602780146,0.02670250748488326,0.03142415763847854,-0.008307521093294192,0.002132113373616139,-0.00462049291152221,0.05106164560225265,0.01905795609652756,-0.01650817398313002,-0.02050878062279473,0.0194142858024751,0.02945806158161851,3.756011998094257e-05,0.00367667409691387,0.009254055686947416,0.0321546104502174,0.02322250265334908,-0.005200185562319352,-0.003328378587252995,0.01515301813178854,0.02214241310144401,0.03569735554270968,-0.00252296442191724,-0.002005317077840981,0.01025863617269038,0.02693197724396411,-0.0009288488882877137,0.006318072584902155,-0.0377315474029596,0.02654616939861694,0.02787085584220562,0.01180274638362174,0.003933692410529023,0.001189662517751012,0.01026192976715297,0.03884977146632414,-0.02003852988724445,-0.008797594647554634,0.004167844605409081,0.06552969291529256,0.04884189036771125,-0.007181000440695945,0.01517184338672279,0.03489680571823342,0.03096300811335184,0.004824198253235098,-0.0131800849900977,-0.009244128165727878,0.05118191761795561,0.0104723037399716,-0.0035460254463092,0.007879078660802365,0.02493413762411368,0.009986156682120207,-0.006493645527459739,-0.003670243591707269,0.01161790589334064,0.01405942267943851,0.02911097046780037,0.02194781008652002,0.014040175620259,-0.018316386039741,0.02612057246894705,0.01143512732687652,0.01212029541532402,-0.02834175577030138,-0.01608829839238593,0.0417552870487623,0.02399510557982852,0.01256565670351335,-0.004879020383369861,0.02563337355941485,0.02918210196020081,-0.007562056348402174,-0.03057462281504263,-0.005533598019325884,0.03638104988281479,0.04580168379354018,-0.008984976577949069,0.006330677841408732,0.003461790956388612,0.01603442243647279,-0.001167024302459215,-0.006429148309504831,0.008394698854698011,0.02657146070794501,0.03089929541345941,0.008626526428970653,0.02030076967014243,0.003642951213872635,0.02072684559445889,0.009013501354996517,-0.01078758712806325,-0.004827560808421198,-0.01300143663565145,0.02340614135677587,0.04458573569353908,0.007468691861794788,-0.00354956814673318,0.02075710004614005,0.02342237349269109,0.0321529745621561,0.001090247250526592,-0.02155407978025193,0.02395642770677284,0.05070020711995852,0.05065732368282343,0.002600193148261281,-0.01234669305781486,0.02840928204912587,0.03063078138450995,-0.01494205566511596,-0.0111708327941407 +0.00365975200607477,0.07559547075969891,-0.03836660955302533,-0.01497707935398282,0.1056124847229805,0.02260290332233027,-0.03578610505128557,0.0858096504918662,0.07614152560979595,-0.03103162429335137,0.05127418919508517,0.09584903624172694,-0.03818070502986744,-0.01113481150406543,0.09984028203163811,-0.01671138713415053,-0.0711331435175282,0.06185452755068128,0.008250205775915693,-0.09165412320245549,0.006804960506785895,0.0378301699351849,-0.08817464197232394,-0.04700892430501483,0.04082331310518487,-0.05995468563652089,-0.09527761930036233,0.03891213639399372,-0.009596492377158521,-0.08983273156152216,0.02682807684478761,0.03759588003755597,-0.0537692504363555,0.000248587520574959,0.08637466920136881,-0.009939317601888563,-0.01198236937793003,0.1021237203138546,0.04627375002796631,-0.0259517364402766,0.08049148814689308,0.08187947999896769,-0.03199948126977759,0.03275871052576546,0.09559328267450878,-0.01016917423099353,-0.01687073208103741,0.07359758782833549,-0.003621269874294287,-0.05311233277792756,0.02478527696308564,0.004757951694801019,-0.07336402935606262,-0.008759017855611534,0.01489880539071592,-0.07760193261705632,-0.0607973590526597,0.009592327810308571,-0.05127313639611786,-0.06727573557615871,0.02481862128535584,-0.01094867042317697,-0.05046013393643867,0.01603718174422546,0.04494859642454748,-0.0274947588801883,-0.0001269987638072845,0.05788467991632283,0.01170466191024394,0.01002556837980551,0.06372443647790536,0.03891907760603627,-0.002470407204071588,0.06223774513409622,0.06278267712221294,0.007794389944312398,0.02584793980742916,0.04684910791134548,-0.0006505332827937802,-0.01181971422858727,0.03036783605497579,0.002279449207731537,-0.02452691090567748,-0.005001704950544052,-0.005064849760071397,-0.04003263773963271,-0.02503378936877675,-0.01588579872055288,-0.0396219515472189,-0.02855757937969473,-0.002687822888606669,-0.01557998968314216,-0.02800216455833211,0.0009199204856918334,-0.005075782991601876,-0.0007063130109498826,0.0005301644008270587,0.006720402474948971,0.0191924732534853,0.0164399013013096,0.03617268503894357,0.02676801214415469,0.03141957506507713,0.02989363225805164,0.0419428409679492,0.03691072971115831,0.0209848569630763,0.02940410394234517,0.04283780405565109,0.02673511006976673,0.01189718737330337,0.02727813134762412,0.008467993119073104,-0.01216043097850139,-0.01092803189537986,0.0133109047988485,-0.02970380198541645,-0.02758528421820621,0.008122379618944931,-0.011035270767847,-0.03137443675110994,0.009762965348874303,0.0006368435448866769,-0.04489082004806555,-0.00793505980453077,0.0271539286271464,-0.02747052121566959,-0.01998843174748995,0.03290368888429937,0.00822866637943351,-0.02456264509031229,0.04262042632146944,0.03826227712611106,-0.02194459604099198,0.03014968307704429,0.0613148748069287,-0.006594316382126549,0.01989829660935505,0.07277483139411774,0.0191129550685332,-0.007912352218267272,0.06469197814380505,0.02384959459467273,-0.02846203087413524,0.02008786683190533,0.05322133701326283,-0.0464096496365227,-0.001975523576516527,0.05031018865138853,-0.03723191606976303,-0.04998900197918116,0.03852737049923842,-0.00491716074418668,-0.05824916362368438,0.02792875449103853,0.03367411307839448,-0.05791067986651342,0.002426819725546116,0.07265463694977189,-0.02543286935558761,-0.02532549066982702,0.07039957863134877,0.003637118594193054,-0.03792225355648137,0.05223536348866537,0.0511187799372033,-0.04574430417858708,0.03048514949866331,0.07950384969890224,-0.02872590834114413,-0.004806157302263078,0.08833244810943357,-0.003354432904265033,-0.05162554297161518,0.06481575710534694,0.04038736801201153,-0.06789909399276663,0.02228191268781719,0.07999626211923906,-0.05826160031880571,-0.02556841818226237,0.08710573259362926,-0.02928412569799663,-0.05022029216202248,0.07591799455092631,0.03058081736147208,-0.0646078153587223,0.03358674738870691,0.07018192586114697,-0.06511046046225064,0.00397755382674882,0.08830210975243394,-0.03514193212771359,-0.03576844322787419,0.07786200154948116,0.008791244869259977,-0.07394651007772989,0.0643685222253617,0.05536740521183604,-0.07103204529329349,0.00731950401214954,0.01845703366652365,0.02170479330425442,0.01275697791845721,-0.01934352590995601,-0.0144783158144138,0.01652192301660001,-0.001474610158822161,-0.01800769984141961,-0.01560527104825628,-0.01581771721671247,-0.007516272800975753,0.003339727484948461,0.01489031749529437,0.01821029230792144,-0.01591860661813439,-0.0154636968900828,0.01722581884661886,-0.005073590885682957,0.010080312886528,0.008829641271685135,-0.001168123769972454,0.008096484998907064,0.03412132652567838,0.04096775968420555,0.03281053747250631,-0.01726812260858424,-0.006905160637536684,0.002019315869437193,0.02092588069918766,0.02766914061288804,-0.02967685378060795,-0.01794056063535771,-0.01294317243826454,0.03359832165576275,0.04267674945330621,0.01424700475926735,-0.006192071624266072,0.0001229304977821179,0.005242944913758526,0.02415282883659376,0.01117598491404125,-0.04026028991922911,-0.02932392287434949,0.02037715179518857,0.03339514084764637,0.01492983653731085,0.02042904843356449,0.001017076012890979,0.003335273688583727,-0.006688077689543719,0.0009758139834881415,0.012995135305324,0.01230014924729716,-0.01420841218962137,-0.02478713640333317,-0.01252570286833829,0.01109475120003598,0.01214192731005147,-0.0001557339309933552,-0.0004311289124639024,-0.02514134400822733,0.02603424004285861,0.03043207494251917,0.01303549764847331,-0.03487817377534126,-0.03748011403747645,0.00745178930330908,0.0384685186614664,0.03049684115184121,-0.01819201323184683,-0.02264622103082935,-0.006678780391944318,0.04265218139167617,0.02627875903578366,-0.005971163123149948,-0.02407755141789285,-0.01320624596223144,0.01111018119209939,0.008617467374439605,0.01859264619651685,0.0122951360030715,0.008977415369444644,-0.006358153320949724,0.01219475205563943,0.007999406904112792,-0.003478112289863147,-0.02140294908364618,-0.02395273878957573,0.002340227212551566,0.03757080683810728,0.04524209697197017,0.009434720869946924,0.002478837308694175,-0.01471566877170347,0.0242512616888476,0.01454595674281837,-0.007282333891839684,-0.01564341077084442,-0.03887729034056508,0.02416503019038956,0.03132207473451365,0.02973174988650754,0.003753787362227233,0.006358634663857506,-0.002013798999383689,0.01051926727338058,0.03618547940932302,0.01215349828883527,-0.01705025669839832,0.0008618282223795386,0.02917487911631683,0.009006969485102923,0.02410030470836699,-0.001325514113231967,0.009853035719666782,-0.01098884119796632,0.006724039277247022,0.01460631933333447,0.01462336136248081,0.01027645773244239,0.004033221866758467,-0.00846889830146735,0.005862555141816859,0.03473055158583697,0.03662606788248502,-0.009036918782192578,-0.02522784763103906,-0.01181244590923607,0.0279250509356727,0.00163068002204261,-0.02137824386220264,-0.03123543890144977,-0.02051928975629454,0.02361143956630986,0.04168708934058984,0.01684316419179207,0.008760109209867492,-9.024969807952532e-05,0.03668496994709861,0.04346574649612081,0.01836712136420517,-0.02964562017031284,0.001478649185082077,-0.007755134339752421,0.04461979728725161,0.0228976628706449,0.03628785913448163,0.004762011696949177,-0.01196138396187388,-0.002187756268064314,-0.004726174472157011,-0.004459390239787774,0.009850560066768849,-0.00713345640287588,-0.01463972099196301,0.01263015868310883,0.04324011359603362,0.05165399796498187,0.02001493129151441,-0.004398234348563494,-0.01178288021902401,0.00408572911917977,0.0435112234007398,-0.01620838754785839,-0.03116416736228433,-0.009795062591996076,0.03104453271853628,0.04017305828123535,0.0321404800188977,0.01501049909504574,-0.01123798670173933,-0.001069296245867995,0.02215580058416052,0.009610112111156879,-0.008523229600036972,-0.02516905840885047,-0.01159044533825004,0.04478929209910302,0.02241174206072444,0.005156388659695334,0.01950253829831671,-0.0122217576720928,0.01666997249032842,0.02165478613300555,0.02639193549581724,0.02102351705436838,-0.01534684365933732,0.001282705734729566,-0.003561909537248052,0.04254506072654708,0.03833900696670114,0.004387618637005312,0.006872664451654344,-0.02150236850574891,-0.002445015954926959,0.01510490609962763,0.03209253547817099,-0.02749098263428163,-0.0350207921842903 From 018ca87a6765caf2eaf67ce049083a27b331133e Mon Sep 17 00:00:00 2001 From: "guillaume.bonabau" Date: Mon, 18 Mar 2024 08:34:07 +0100 Subject: [PATCH 2/2] debbugged RoI --- main.m | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/main.m b/main.m index a6c7923..fcf9081 100644 --- a/main.m +++ b/main.m @@ -51,14 +51,14 @@ signal_2 = signal(end/2+1:end); %%%%%SPECTRAL ANALYSIS (RECTANGULAR WINDOW)%%%%% %plots power spectrum with rectangular window % 1st part of the signal with 1 Hz resolution -frequencySpectrum(signal_1, fps, 1); +frequencySpectrum(signal_1, fps, 1, RoI); % 1st part of the signal with 0.5 Hz resolution -frequencySpectrum(signal_1, fps, 0.5); +frequencySpectrum(signal_1, fps, 0.5, RoI); % 2nd part of the signal with 1 Hz resolution -frequencySpectrum(signal_2, fps, 1); +frequencySpectrum(signal_2, fps, 1, RoI); % 2nd part of the signal with 0.5 Hz resolution -frequencySpectrum(signal_2, fps, 0.5); +frequencySpectrum(signal_2, fps, 0.5, RoI); @@ -66,15 +66,15 @@ frequencySpectrum(signal_2, fps, 0.5); %plots power spectrum with blackman window signal_1_win = blackmanWin(signal_1); % 1st part of the signal with 1 Hz resolution -frequencySpectrum(signal_1_win, fps, 1); +frequencySpectrum(signal_1_win, fps, 1, RoI); % 1st part of the signal with 0.5 Hz resolution -frequencySpectrum(signal_1_win, fps, 0.5); +frequencySpectrum(signal_1_win, fps, 0.5, RoI); signal_2_win = blackmanWin(signal_2); % 2nd part of the signal with 1 Hz resolution -frequencySpectrum(signal_2_win, fps, 1); +frequencySpectrum(signal_2_win, fps, 1, RoI); % 2nd part of the signal with 0.5 Hz resolution -frequencySpectrum(signal_2_win, fps, 0.5); +frequencySpectrum(signal_2_win, fps, 0.5, RoI);