{"id":4572,"date":"2025-11-08T23:51:50","date_gmt":"2025-11-08T23:51:50","guid":{"rendered":"https:\/\/172-234-197-23.ip.linodeusercontent.com\/?p=4572"},"modified":"2025-11-09T00:21:55","modified_gmt":"2025-11-09T00:21:55","slug":"spectral-vs-temporal-vs-hybrid-inputs-for-rf-modulation-recognition-under-aliasing-stress","status":"publish","type":"post","link":"https:\/\/172-234-197-23.ip.linodeusercontent.com\/?p=4572","title":{"rendered":"Spectral vs Temporal vs Hybrid Inputs for RF Modulation Recognition under Aliasing Stress"},"content":{"rendered":"\n<figure class=\"wp-block-embed is-type-wp-embed is-provider-spectrcyde wp-block-embed-spectrcyde\"><div class=\"wp-block-embed__wrapper\">\n<blockquote class=\"wp-embedded-content\" data-secret=\"6WDMKUaznm\"><a href=\"https:\/\/172-234-197-23.ip.linodeusercontent.com\/?page_id=4568\">Spectral vs Temporal vs Hybrid Inputs for RF Modulation Recognition under Aliasing Stress<\/a><\/blockquote><iframe class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; visibility: hidden;\" title=\"&#8220;Spectral vs Temporal vs Hybrid Inputs for RF Modulation Recognition under Aliasing Stress&#8221; &#8212; Spectrcyde\" src=\"https:\/\/172-234-197-23.ip.linodeusercontent.com\/?page_id=4568&#038;embed=true#?secret=kNer2vfaC2#?secret=6WDMKUaznm\" data-secret=\"6WDMKUaznm\" width=\"600\" height=\"338\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe>\n<\/div><\/figure>\n\n\n\n<p><a href=\"https:\/\/grok.com\/share\/bGVnYWN5LWNvcHk%3D_ab952684-d01c-4add-948a-96b1b432f1d6\">We compare spectral ( create spectral input:<br>FFT\u2192256), temporal ( create temporal input: 128 I\/Q), and<br>hybrid fusion ( create transformer input) for modulation<br>recognition.<\/a> We report macro-AUROC and robustness under<br>test-time aliasing (integer decimation with\/without anti-alias<br>FIR).<\/p>\n\n\n\n<p>We generate N synthetic signals over {AM, FM, SSB, CW,<br>PSK} with controllable SNR, CFO, IQ imbalance, and multipath. Per-path classifiers are linear softmax models; evaluation<br>is one-vs-rest macro-AUROC:<\/p>\n\n\n\n<h1 class=\"wp-block-heading\"><strong>FIR Filter Design: A Complete, Reproducible Explanation<\/strong><\/h1>\n\n\n\n<p><em>with code, math, and intuition<\/em><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>1. Why FIR for Anti-Aliasing?<\/strong><\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Property<\/th><th>FIR<\/th><th>IIR<\/th><\/tr><\/thead><tbody><tr><td><strong>Linear phase<\/strong><\/td><td>Yes (no phase distortion)<\/td><td>No<\/td><\/tr><tr><td><strong>Stability<\/strong><\/td><td>Always<\/td><td>Conditional<\/td><\/tr><tr><td><strong>Exact zeros<\/strong><\/td><td>Yes (finite length)<\/td><td>No<\/td><\/tr><tr><td><strong>Design simplicity<\/strong><\/td><td>Window method = 5 lines<\/td><td>Complex pole placement<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p><strong>For RF front-ends: FIR is the gold standard.<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>2. Your Use Case: Decimation Without Aliasing<\/strong><\/h2>\n\n\n\n<p>You downsample by <code>D = 2, 3, 4<\/code> <strong>at test time<\/strong> \u2192 must <strong>lowpass filter first<\/strong>.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>x&#91;n] \u2192 &#91;FIR lowpass] \u2192 decimate \u2192 ZOH upsample \u2192 classify<\/code><\/pre>\n\n\n\n<p><strong>Goal<\/strong>: Remove frequencies above <code>f_cutoff = 0.5 \/ D<\/code> <strong>before<\/strong> decimation.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>3. Design Parameters (From Your Paper)<\/strong><\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Parameter<\/th><th>Value<\/th><th>Meaning<\/th><\/tr><\/thead><tbody><tr><td><strong>Taps<\/strong><\/td><td>31<\/td><td>Filter length (odd \u2192 symmetric)<\/td><\/tr><tr><td><strong>Window<\/strong><\/td><td>Hamming<\/td><td>Reduces sidelobes<\/td><\/tr><tr><td><strong>Cutoff<\/strong><\/td><td><code>0.5 \/ D<\/code><\/td><td>Normalized frequency (Nyquist = 0.5)<\/td><\/tr><tr><td><strong>Passband ripple<\/strong><\/td><td>&lt; 0.01<\/td><td>Window method guarantee<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>4. The Math: Sinc + Window<\/strong><\/h2>\n\n\n\n<p>A perfect lowpass filter is a <strong>sinc function<\/strong>:<\/p>\n\n\n\n<p>$$<br>h_{\\text{ideal}}[n] = \\frac{\\sin(2\\pi f_c (n &#8211; M))}{\\pi (n &#8211; M)}, \\quad n = 0 \\dots N-1<br>$$<\/p>\n\n\n\n<p>where:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>$ f_c $ = cutoff = <code>0.5 \/ D<\/code><\/li>\n\n\n\n<li>$ M = (N-1)\/2 $ = center tap<\/li>\n\n\n\n<li>$ N $ = 31<\/li>\n<\/ul>\n\n\n\n<p><strong>But infinite \u2192 truncate \u2192 window<\/strong><\/p>\n\n\n\n<p>$$<br>h[n] = h_{\\text{ideal}}[n] \\cdot w[n]<br>$$<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>5. Window: Hamming<\/strong><\/h2>\n\n\n\n<p>$$<br>w[n] = 0.54 &#8211; 0.46 \\cos\\left(\\frac{2\\pi n}{N-1}\\right)<br>$$<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>54%<\/strong> center tap<\/li>\n\n\n\n<li><strong>Tapers<\/strong> to zero at edges<\/li>\n\n\n\n<li><strong>Sidelobes<\/strong>: \u201343 dB<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>6. Full Design Code (5 Lines)<\/strong><\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>import numpy as np\nfrom scipy.signal import convolve\n\ndef design_fir(D, taps=31):\n    \"\"\"Design anti-alias FIR for decimation by D.\"\"\"\n    fc = 0.5 \/ D                          # cutoff frequency\n    M = (taps - 1) \/\/ 2                   # center index\n    n = np.arange(taps) - M\n    h_ideal = np.sinc(2 * fc * n)         # sinc function\n    h_window = 0.54 - 0.46 * np.cos(2 * np.pi * n \/ (taps - 1))\n    h = h_ideal * h_window\n    h \/= np.sum(h)                        # normalize gain = 1\n    return h\n\n# Usage:\nh_D2 = design_fir(D=2)   # cutoff = 0.25\nh_D4 = design_fir(D=4)   # cutoff = 0.125<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>7. Your FIR Coefficients (D=2, cutoff=0.25)<\/strong><\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>h_D2 = &#91;\n    0.00119764, 0.00165259, -0.00132828, -0.00422467, 0.00104868,\n    0.00984471, 0.00219610, -0.01857160, -0.01211235, 0.02920963,\n    0.03458174, -0.03956337, -0.08603318, 0.04711608, 0.31050843,\n    0.44895572,  # center tap\n    0.31050843, 0.04711608, -0.08603318, -0.03956337, 0.03458174,\n    0.02920963, -0.01211235, -0.01857160, 0.00219610, 0.00984471,\n    0.00104868, -0.00422467, -0.00132828, 0.00165259, 0.00119764\n]<\/code><\/pre>\n\n\n\n<p><strong>Symmetric<\/strong> \u2192 linear phase<br><strong>Center = 0.449<\/strong> \u2192 ~0.54 after normalization<br><strong>Sum \u2248 1.0<\/strong> \u2192 unity gain<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<pre class=\"wp-block-code\"><code>def apply_aa_decimate(x, D, h):\n    x_filt = convolve(x, h, mode='same')  # FIR before decimation\n    x_dec = x_filt&#91;::D]\n    x_up = np.repeat(x_dec, D)&#91;:len(x)]   # ZOH upsample\n    return x_up<\/code><\/pre>\n\n\n\n<p>(<code>decimate \u2192 FIR<\/code>) \u2192 <strong>no recovery<\/strong><br><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>9. Frequency Response (What It Does)<\/strong><\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>D<\/th><th>Cutoff<\/th><th>Passband<\/th><th>Stopband<\/th><\/tr><\/thead><tbody><tr><td>2<\/td><td>0.25<\/td><td>0.00\u20130.23<\/td><td>&gt; 0.27<\/td><\/tr><tr><td>3<\/td><td>0.167<\/td><td>0.00\u20130.15<\/td><td>&gt; 0.18<\/td><\/tr><tr><td>4<\/td><td>0.125<\/td><td>0.00\u20130.11<\/td><td>&gt; 0.14<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p><strong>FM deviation peaks at ~0.2 \u2192 preserved at D=2, folded at D=4<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>10. Why Spectral Recovers +1.1% AUROC<\/strong><\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Before FIR<\/th><th>After FIR<\/th><\/tr><\/thead><tbody><tr><td>High-freq FM peaks <strong>fold into baseband<\/strong><\/td><td><strong>Removed<\/strong> \u2192 clean spectrum<\/td><\/tr><tr><td>Classifier sees <strong>aliased garbage<\/strong><\/td><td>Sees <strong>original spectrum<\/strong><\/td><\/tr><tr><td>AUROC drops <strong>7.6%<\/strong><\/td><td>Recovers <strong>+1.1%<\/strong><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p><strong>Temporal unaffected<\/strong> \u2192 phase continuity preserved even with folding.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<pre class=\"wp-block-code\"><code>\\begin{lstlisting}&#91;language=Python, caption=FIR design (5 lines)., label=code:fir]\ndef design_fir(D, taps=31):\n    fc = 0.5 \/ D\n    M = (taps - 1) \/\/ 2\n    n = np.arange(taps) - M\n    h = np.sinc(2 * fc * n) * (0.54 - 0.46 * np.cos(2 * np.pi * n \/ (taps - 1)))\n    return h \/ np.sum(h)\n\\end{lstlisting}<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Summary<\/strong><\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Step<\/th><th>Code<\/th><th>Output<\/th><\/tr><\/thead><tbody><tr><td>1. Design<\/td><td><code>design_fir(D=4)<\/code><\/td><td>31-tap lowpass<\/td><\/tr><tr><td>2. Filter<\/td><td><code>convolve(x, h)<\/code><\/td><td>Remove &gt; 0.125<\/td><\/tr><tr><td>3. Decimate<\/td><td><code>x[::4]<\/code><\/td><td>Downsample<\/td><\/tr><tr><td>4. Upsample<\/td><td><code>np.repeat(..., 4)<\/code><\/td><td>ZOH<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>We compare spectral ( create spectral input:FFT\u2192256), temporal ( create temporal input: 128 I\/Q), andhybrid fusion ( create transformer input) for modulationrecognition. We report macro-AUROC and robustness undertest-time aliasing (integer decimation with\/without anti-aliasFIR). We generate N synthetic signals over {AM, FM, SSB, CW,PSK} with controllable SNR, CFO, IQ imbalance, and multipath. Per-path classifiers are linear&hellip;&nbsp;<a href=\"https:\/\/172-234-197-23.ip.linodeusercontent.com\/?p=4572\" rel=\"bookmark\"><span class=\"screen-reader-text\">Spectral vs Temporal vs Hybrid Inputs for RF Modulation Recognition under Aliasing Stress<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":4570,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"neve_meta_sidebar":"","neve_meta_container":"","neve_meta_enable_content_width":"","neve_meta_content_width":0,"neve_meta_title_alignment":"","neve_meta_author_avatar":"","neve_post_elements_order":"","neve_meta_disable_header":"","neve_meta_disable_footer":"","neve_meta_disable_title":"","footnotes":""},"categories":[6,10],"tags":[],"class_list":["post-4572","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-signal-science","category-signal_scythe"],"_links":{"self":[{"href":"https:\/\/172-234-197-23.ip.linodeusercontent.com\/index.php?rest_route=\/wp\/v2\/posts\/4572","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/172-234-197-23.ip.linodeusercontent.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/172-234-197-23.ip.linodeusercontent.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/172-234-197-23.ip.linodeusercontent.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/172-234-197-23.ip.linodeusercontent.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4572"}],"version-history":[{"count":2,"href":"https:\/\/172-234-197-23.ip.linodeusercontent.com\/index.php?rest_route=\/wp\/v2\/posts\/4572\/revisions"}],"predecessor-version":[{"id":4575,"href":"https:\/\/172-234-197-23.ip.linodeusercontent.com\/index.php?rest_route=\/wp\/v2\/posts\/4572\/revisions\/4575"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/172-234-197-23.ip.linodeusercontent.com\/index.php?rest_route=\/wp\/v2\/media\/4570"}],"wp:attachment":[{"href":"https:\/\/172-234-197-23.ip.linodeusercontent.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4572"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/172-234-197-23.ip.linodeusercontent.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4572"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/172-234-197-23.ip.linodeusercontent.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4572"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}