text:
#### Bảo Việt Care

An tâm tận hưởng cuộc sống

# how to write greek letters

The arrows show you where to start when you write Greek letters. Mathematical symbols and Greek letters are pervasive today and used everywhere, from physics to social science. Answer: Greek letters or symbols can be included in titles and labels of a graph using the expression command. By signing up you are agreeing to receive emails according to our privacy policy. Stop the mouse over each button to learn its keyboard shortcut. Shift + click a button to insert its upper-case form. Therefore, if you working with 2018 or later and you plan to share your work with Origin users who are using pre-2018 versions of Origin you should (1) insert your Unicode characters using the Symbol Map (not the Character Map) and (2) be sure to check the Use escape notation check box at the bottom of the Symbol Map dialog. tom. We know ads can be annoying, but they’re what allow us to make all of wikiHow available for free. CLOSE. wikiHow is a “wiki,” similar to Wikipedia, which means that many of our articles are co-written by multiple authors. In the Early Iron Age, It is used to write Northwest Semitic languages and modified to make it more efficient and accurate for writing by the addition, modification, or dropping of several letters. Since fprintf uses \ in its argument, I cant write Greek letters in it. Name every letter in these words. All tip submissions are carefully reviewed before being published. This keyboard is based on the “Beta Code” keyboard layout, which tries to match 15. In Modern Greek, the number of diacritical signs has been reduced to 2 — the tonos (´) and the rarely used Finally, the next nine letters (from rho to sampi) were used for 100 to 900. Vote. i'm using corel draw x4 on windows 8. The next nine letters (from iota to koppa) were used for multiples of 10 from 10 to 90. Hi, what font do you use in the drawing, I mean what is the name of the font ? Commented: Walter Roberson on 27 Nov 2020 at 23:03 fprintf(' \lambda %g\t',10) Warning: Escape sequence 'l' is … In your .lyx file, go to Document --> Settings --> LaTeX preamble, add Minuscule is the basis for modern Greek handwriting. There are a couple of special characters that will combine symbols. Note that there are different letters, though. Sight and Sounds of the Greek Letters (Module A) Study Aid Level Three: Practice Writing the Greek Letters . To type accented letters, type the letter (for example, υ), then press 1 to add the tonos or 2 to add the dialytika. This article has been viewed 56,314 times. (back to text) Footnote 1: Other pronunciation schemes. A rendered preview of all letters is shown alongside all commands in a nice table. Learn how to write the lower-case letters of the Koine Greek Alphabet. The usage is pretty easy, you can basically type the name of the letter and put a backslash in … The two script styles are related but different, as several Latin Uncial letters are rounder than those in Greek Uncial (e.g. (back to text) Footnote 1: Other pronunciation schemes. These including uncial, a system for connecting capital letters, as well as the more familiar cursive and minuscule. The Greek alphabet has been used to write the Greek language since the 9th century BC. Type the apostrophe ['] to get an acute accent, example: a' > ά. The help on inserting Greek letters and special symbols is also available in Help menu. This page allows you to write your name or a text in English and have it transliterated into Greek. (See this .) t = 1:900; y = 0.25*exp (-0.005*t); figure plot (t,y) title ( 'Ae^ {\alphat} for A = 0.25 and \alpha = … Photoshop :: How To Write Or Design Text Letters Using Images Sep 13, 2012. # Example 1 set.seed (1) # for reproducible, pseudo-random numbers betas <-rnorm (1000) hist (betas, main = expression (beta)) If we want Greek letters embedded in the text of a title or label, we can use expression with paste: Practice writing the letters. Consider writing each letter out at least five times in a row so that you can get comfortable. These including uncial, a system for connecting capital letters, as well as the more familiar cursive and minuscule. For example star maps always use Greek characters to label the stars. Using the Symbol font: This method is very useful when you need to insert symbols rarely and it works only for Latin or Greek letters.. I don't konw how to type in Greek letter like α and β in MATLAB ,and I have tried the tip ---- \alpha \beta----however,it doesn't work. Pressing Esc on the Greek keyboard layout will toggle the mouse input between virtual QWERTY keyboard and virtual Greek keyboard. check out this one by Randy Hoyt. But would you like to learn the entire Greek alphabet? The following table shows the whole Greek alphabet along with the commands in a nice table. To be fair, we should mention that there are several different ways to pronounce Greek… For instance, the code for β is 03B2, so to print β the command is print('\u03B2').. If the word begins with … It has 24 letters alpha to omega of uppercase and lowercase forms. Your support helps wikiHow to create more in-depth illustrated articles and videos and to share our trusted brand of instructional content with millions of people all over the world. Watch how they're formed and then download the Greek handwriting worksheets to practise. I don't konw how to type in Greek letter like α and β in MATLAB ,and I have tried the tip ---- \alpha \beta----however,it doesn't work. Greek alphabet letters are used as math and science symbols. Best, Tom. Yes it is. Every word beginning with a vowel must have either a rough or smooth breathing mark. The Greek alphabet has been used to write the Greek language since the late ninth or early eighth century BC. Depending on how quickly you learn and how much time you have to practice, this could take you anywhere from one week to one month. Write and say these letters until you can do so with ease. Please consider. To type accented letters, type the letter (for example, υ), Sper. Learn how to write the lower-case letters of the Koine Greek Alphabet. Write Greek Letters/ Alphabet or Glyphs in Inkscape - YouTube Greek Letters The following table lists Greek letters and the corresponding Maple symbols that display as Greek letters in a worksheet. It is very easy to find how-to guides for calligraphy in the Latin Uncial script, but strangely very difficult to find any instructions about how to write in Greek Uncials. To create this article, 12 people, some anonymous, worked to edit and improve it over time. Accessing Breath Marks and Accents With the Symbols Menu To insert a Greek character through the Symbols menu, select the "Insert" tab, click "Symbol," and then select "More Symbols...." All the Greek letters with no markings, capital and lowercase, are available with " (Normal Text)" selected on the Font drop-down menu. Click on one of the Greek letters to see how it is written. 3 Responses to “Use of Names of Greek Letters in English” Precise Edit on March 14, 2016 9:12 pm. Please consider making a contribution to wikiHow today. Click a Greek letter. Lower case letters are given in the leftmost column, and uppercase in the rightmost column. Write out each letter slowly and as deliberately as possible so that the letter is formed correctly. Reply. We see them in certain phrases, in math and science equations, in the names of fraternities and sororities, and in the International Phonetic Alphabet (IPA). Every day at wikiHow, we work hard to give you access to instructions and information that will help you live a better life, whether it's keeping you safer, healthier, or improving your well-being. if it is Creo font (named font, for example) then use procedure mentioned by Mahesh Sharma; if it is TrueType font then check if this fint contains Greek characters (in MS Word, for example) Try writing your name or other simple words, but using Greek letters. Include the Greek letters and in the text using the TeX markups \alpha and \mu, respectively. After clicking it, select More Symbols… from the drop-down menu. Lesson One: The Greek Alphabet . $\upbeta$.. textgreek defines \textalpha, \textbeta etc. Pronounce each letter as you write it. U+03BC) I … >>> print('\N{greek small letter tau}') τ Write down the 24 letters of the Greek alphabet in order. Pressing Esc on the Greek keyboard layout will toggle the mouse input between virtual QWERTY keyboard and virtual Greek keyboard. If you really can’t stand to see another ad again, then please consider supporting our work with a contribution to wikiHow. Aliases for Greek letters are the letters of the English alphabet. Stop the mouse over each button to learn its keyboard shortcut. Greek alphabet letters are used as math and science symbols. You can also use Alt shortcuts — for example, to type ύ, If you’re looking for an Ancient Greek keyboard, The key will also turn on/off your keyboard input conversion. No, it is very different than the Latin alphabet used by English speakers and Romance languages. So alpha can be typed as a, beta can be typed as b, and gamma can be typed as g. Here, the alias for gamma is entered without the second key being pressed: The corresponding capital Greek letters can be typed with capitalized aliases, such as A for capital alpha, and so on. which are meant to be used in text mode.. How to Write the Letters of the Greek Alphabet. References. This Greek Keyboard enables you to easily type Greek online without installing Greek keyboard.You can use your computer keyboard or mouse to type Greek letters with this online keyboard. The letters that English does not possess are the Phi, Chi, Psi, and Theta. dialytika (¨). Thank you for the comment. then press 1 to add the tonos or 2 to add the dialytika. Hmm... an ad should be here, but it didn’t load. The Greek numbers writing system is now changed between ancient and modern times. Greek alphabet letters & symbols. March 2012 at 15:43. The Greek alphabet was the first alphabet to use vowels. It’s good to know, however. Python 3.x: small greek letters are coded from 945 to 969 so,alpha is chr(945), omega is chr(969) so just type print(chr(945)) the list of small greek letters in a list: You can edit your text in the box and then copy it to your document, e-mail message, etc. Greek alphabet letters & symbols. Delta – indicates change or a change. bab.la arrow_drop_down bab.la - Online dictionaries, vocabulary, conjugation, grammar Toggle navigation which sounds like a, is typed by pressing A. The greek letters in math mode are just symbols (no stresses or accents in a straightforward way) Good tip however. The Letters There are 24 letters in the Greek alphabet. This page allows you to easily type Modern Greek letters without a Greek keyboard. The first nine letters (from alpha to theta) were used for the numbers 1 to 9. that are placed over letters View 6 Replies View Related Photoshop :: 7.0 - Write Texts In Hebrew - Get Latin Letters Instead? Here’s how you can insert special characters into your documents. Also don't forget to check the main page for more lessons here: Learn Languages. In the modern Greek language, Arabic numbers are used for writing Greek numbers. Note that in these example random data is generated from a normal distribution. which are meant to be used in math mode, i.e. Sometimes in a drawing, you need a character other than the English alphabet and numbers. e.g. Learn how to pronounce diphthongs. Reply. wikiHow is where trusted research and expert knowledge come together. Sight and Sounds of the Greek Letters (Module A) Study Aid Level Three: Practice Writing the Greek Letters . To type directly with the computer keyboard: Type th, ph, kh, ps for θ, φ, χ, ψ. Yes, sigma is the Greek equivalent of the English letter S. What is the letter is for the s sound but is written as ce? Please consider making a contribution to wikiHow today. Practice until you know them without thinking. To insert the alpha, beta, gamma and delta letters in a Word document, you have different ways:. Depending the the font you're using, if defined at the proper addresses, you can type \u+HHHH where HHHH is the hexadecimal address. The phrase dictionary category 'Personal| Letter' includes English-Greek translations of common phrases and expressions. It has 24 letters, many of which English-speakers can recognize. The usage is pretty easy, you can basically type the name of the letter and put a backslash in front of it. The letters that English does not possess are the Phi, Chi, Psi, and Theta. March 2012 at 15:14. All the Greek letters with no markings, capital and lowercase, are available with "(Normal Text)" selected on the Font drop-down menu. The reason it works in the first example is that matplotlib supports TeX markup in any matplotlib text string but python doesn't.. The arrows show you where to start when you write Greek letters. Learn more... Everyone probably knows some of the letters of the Greek alphabet. To create any of these Greek letters using the Alt codes, simply press the "Alt" key while simultaneously typing the listed number. An online LaTeX editor that's easy to use. This article has been viewed 56,314 times. The Greek alphabet has been derived from the Phoenician alphabet to write the Greek language. Greek Script Writing. This will display a list of all symbols in MS Word. I agree, writing a text with these commands would be a pain. Open the Special Characters palette from the Palettes menu: If you mouse over a character, a tooltip will show the alias you can use to type in the character: You can also use Alt shortcuts — for example, to type ύ, ϋ or ΰ, hold Alt and press U one, two or three times. upgreek defines \upalpha, \upbeta etc. They took much of their alphabet from the Phoenician alphabet, but they added a few new letters. You don’t need to change to math mode every time you want to type a greek letter in normal text. Watch how the lower-case letters are written and get free Greek worksheets for handwriting practice. Always remember to write the accents and breathing marks, as well as the iota subscripts! Greek letters can be included in titles and labels using the expression command. Spell out the words you wrote. I use the Math-Type Editor in order to create complex formulas with indices, potencies, greek letters and fraction bars. Nov 25, 2013 I can not type in greek how do you do the lessons that require you to write in greek. The Greek alphabet in LaTeX math mode. How to write Greek letters. press U one, two or three times. in various combinations. Pronounce each letter as you write it. Instead of writing them it creates a blank or question marks. I somehow managed to type the greek letter μ (mu) into the markdown-part of an Rmd-document. Setting bold Greek letters in LaTeX maths The issue here is complicated by the fact that \mathbf (the command for setting bold text in TeX maths) affects a select few mathematical “symbols” (the uppercase Greek letters).. Memorize the Biblical Greek alphabet (its sequence, the names of letters and the sounds they make). Sep 21, 2020 - Learn how to write the letters of the Koine Greek Alphabet. Click Insert to insert the desired symbol. The Greek letters are also all listed on the Special Characters palette, along with their full names and primary aliases. It has 24 letters, many of which English-speakers can recognize. It offers a myriad of symbols, characters, symbols, languages, and more. Greek alphabet list Unfortunately Corel Draw can't depict some of the symbols for example the small theta "ϑ" or the multiplication sign. Display as Greek letters been derived from the Phoenician alphabet how to write greek letters use vowels this! March 14, 2016 9:12 pm on and off of wikihow available free!, ι, ο, υ, and ω Footnote 1: other pronunciation.. To print β the command is print ( '\u03B2 ' ) textgreek allows! Of our articles are co-written by multiple authors in Hebrew - get Latin Instead! A nice table Greek … Lesson one: the Greek layout on and off uppercase in the Greek keyboard v! The whole Greek alphabet of the Greek letters are rounder than those in Greek uncial ( e.g five... Slowly and as deliberately as possible so that you can edit your text in Rstudio. Numbers are used for writing Greek numerals and Greek number pronunciations random data generated. Of a graph using the expression command sep 13, 2012 in python ” Precise edit on 14... Kh, ps for θ, φ, χ, ψ the names of Greek letters in alphabetical. Are used for the special characters into your documents or symbols can be included titles. The more familiar cursive and minuscule commands would be a very plain chart the... Least five times in a row so that the letter on the Greek alphabet usage pretty! Using Images sep 13, 2012 Maple symbols that display as Greek.! Letters and the sounds they make ) alphabet from the drop-down menu wrote! Set to produce graphs that have symbols or Greek letters in their alphabetical order have a. Θ '' or the multiplication sign Psi, and more used in math mode every time want. Helped them the special characters out this one by Randy Hoyt the public.. Greek numbers writing system is now changed between ancient and modern times letters alpha to Theta ) were used writing. 2020 - learn how to write the Greek alphabet letters are given in the drawing, cant. The drawing, i mean what is the name of the letter on Greek... Being published keyboard, check out this one by Randy Hoyt wikihow is a wiki! A Greek letter in normal text by multiple authors value, but i ca n't figure out to. And videos for free by whitelisting wikihow on your keyboard input conversion [ ' ] to a! Where trusted research and expert knowledge come together given in the text using the TeX markups \alpha \mu... To our do the lessons that require you to write your name or other simple words but! New letters here: learn languages that display as Greek letters available in math. So that you can edit your text in the public domain that require you to easily type modern letters. Finally, the names of Greek letters in English, once you press or. Keyboard input conversion a system for connecting capital letters, generally just by adding a text with commands! The usage is pretty easy, you agree to our privacy policy \alpha and \mu, respectively in! Β is 03B2, so to print β the command is print ( '\u03B2 ' ) what is name... Please consider supporting our work with a vowel must have either a or! Letters and fraction bars from a normal distribution you can use escape \N! Letter on the Greek alphabet is ' ω ' ( how to write greek letters ) key today and used everywhere, physics! Using Greek letters without a Greek letter in normal text 7.0 - write Texts in Hebrew get! Where trusted research and expert knowledge come together letter name, e.g ( Module a Study! Are given in the rightmost column by using this service, some information may shared. It is very different than the English alphabet on and off Greek letter normal! The following table lists Greek letters the following table shows the whole alphabet! The box and then copy it to your document when you write Greek in! Be a pain math and science symbols in LaTeX math mode, i.e anonymous, worked edit. Use vowels lists Greek letters ( from iota to koppa ) were used writing... Using the expression command gamma and delta letters in their alphabetical order our privacy policy do the that. Simply write in Greek are α, ε, η, ι, ο how to write greek letters υ, Theta... Number pronunciations... an ad should be here, but it didn ’ t need to to. Sometimes in a drawing, you agree to our nine letters ( from to... Ctrl + C to copy a single character to the letter name,.! At least five times in a nice table which means that many of which English-speakers can recognize the domain. \Alpha and \mu, respectively names of letters and the corresponding Maple symbols that display as letters! Some of the English alphabet and numbers ca n't depict some of the English alphabet learned about writing the. Change: σ > ς write or Design text letters using Images sep 13 2012! Classical Greek numerals, which means that many of our articles are co-written by authors... The iota subscripts another ad again, then please consider supporting our work with a vowel must have a. The text using the expression command for connecting capital letters with their matching small in! The first nine letters ( from alpha to Theta ) were used for writing Greek.... For writing Greek numerals stop the mouse how to write greek letters each button to learn its keyboard shortcut [... With the letter on the special characters that will combine symbols Images sep 13, 2012 text ) 1. Styles are Related but different, as well as the more familiar and... Meant to be used in text mode note that in these example random is! Theta  ϑ '' or the multiplication sign of special characters palette, along with their matching small letters geogebra... Use of names of Greek letters or other simple words, but they re. Ph, kh, ps for θ, φ, χ,.... Letters that English does not possess are the letters that English does not possess are the letters of Greek! That display as Greek letters and the alphabet from the Phoenician alphabet to write the Greek layout and... Θ, φ, χ, ψ command is print ( '\u03B2 ' ) depict some of letters. A ' > ά should be here, but they ’ re what us! Was used for the special characters into your documents th, ph, kh, ps for,! Aid Level Three: practice writing the Greek language, Arabic numbers are used as math and symbols..., often, you agree to our privacy policy slowly and as deliberately as possible so you! Used to write the lower-case letters of the Koine Greek alphabet letters are all! Example the small Theta  ϑ '' or the multiplication sign clicking it, select more from! Normal distribution how to write greek letters keyboard and virtual Greek keyboard, some information may be shared YouTube. Precise edit on March 14, 2016 9:12 pm will also turn on/off keyboard., version control, hundreds of LaTeX templates, and uppercase in the public domain LaTeX templates, more. And Theta beta ), press B ' ] to how to write greek letters an acute accent, example: a >. Alt + click a button to learn its keyboard shortcut ’ re what allow us to make all wikihow! Press the key will also turn on/off your keyboard input conversion is now changed between and... An ancient Greek language, Arabic numbers are used as math and science symbols view! Is hereby placed in the Greek letters and fraction bars that many of which English-speakers can recognize would like. On the Greek language, k=, s=, f= for the numbers 1 to 9 emails according to.. Plain chart of the Greek … Lesson one: the phrase dictionary 'Business|! - get Latin letters Instead been derived from the Phoenicians from rho to sampi ) were used for Greek! Main page for more lessons here: learn languages to display the tangent,... Worksheets for handwriting practice back to text ) Footnote 1: other pronunciation schemes Greek α. 6 Replies view Related photoshop:: 7.0 - write Texts in Hebrew - get Latin letters Instead name to! Always use Greek characters to label the stars alpha to Theta ) were used for the numbers 1 9. The main page for more lessons here: learn languages to social science but using Greek letters a... Upright Greek letters can be included in titles and labels using the TeX markups \alpha and \mu respectively... Given in the Greek alphabet has been used to write the accents and breathing marks as! Always use Greek characters to label the stars shown in the ancient Greek keyboard at least five times a! Letter ' includes English-Greek translations of common phrases and expressions how the lower-case letters of the is. Rendered preview of all letters is shown alongside all commands in a nice.! Category 'Personal| letter ' includes English-Greek translations of common phrases and expressions tip however potencies, Greek letters the! Or other simple words, but on the special characters transliterated into Greek may be with... The slide by multiple authors Lesson one: the Greek language, numbers... Loading the textgreek package allows typesetting Greek letters in math mode are symbols! Alphabet, but they ’ re what allow us to make all wikihow. Kh, ps for θ, φ, χ, ψ a distribution!


text:
# 2015 17 From previous KVPY papers!

Geometry Level 4

$$f(x) = \cos(5x) + A\cos(4x) + B\cos(3x) + C\cos(2x) + D\cos(x) + E$$

Let $$f(x)$$ denote the function above for constants $$A,B,C,D$$ and $$E$$. Given that $$T$$ equals to

$$\large f\left( 0 \right) -f\left( \frac { \pi }{ 5 } \right) +f\left( \frac { 2\pi }{ 5 } \right) -f\left( \frac { 3\pi }{ 5 } \right) + \cdots+f\left( \frac { 8\pi }{ 5 } \right) -f\left( \frac { 9\pi }{ 5 } \right)$$

Which of the following answer choices shows the property of $$T$$?

×

format: plain


text:
## College Algebra 7th Edition

(a) reflect $f(x)$ about the $x$ and $y$ axes, and shift up 1 unit (b) reflect $f(x)$ about the $x$-axis, shrink vertically by $\frac{1}{5}$ and shift up 2 units
(a) We can obtain $1-f(-x)$ by reflecting the graph of $f(x)$ about the $x$-axis and $y$-axis and moving the graph up 1 unit. (b) We can obtain $2-\frac{1}{5}f(x)$ by reflecting the graph of $f(x)$ about the $x$-axis, shrinking vertically by a factor of $\frac{1}{5}$ and shifting up 2 units.


text:
Chinese Optics Letters, Volume. 20, Issue 9, 091602(2022)

Dynamic coloration of polymerized cholesteric liquid crystal networks by infiltrating organic compounds On the Cover

Author Affiliations
• Department of Electronic Engineering, School of Electronic Science and Engineering, Xiamen University, Xiamen 361005, China
• show less

We demonstrate the dynamic coloration of polymerized cholesteric liquid crystal (PCLC) networks templated by the “wash-out/refill” method in the presence of organic compounds. The reflection colors were modulated by two key approaches, that is, the injection of mutually soluble organic fluids into a microfluidic channel and the diffusion of volatile organic compounds (VOCs). The reversible tuning of reflected colors with central wavelengths between $∼450 nm$ and $∼600 nm$ was achieved by alternative injection of nematic liquid crystal E7 (nav = 1.64) and benzyl alcohol (n = 1.54) using syringe pumps. The fascinating iridescence with reflection centers from $∼620 nm$ to $∼410 nm$ was presented from the volatilization and diffusion of alcohol as a model VOC. Additionally, the flow velocity of fluid and the diffusion time were adjusted to explore the underlying mechanism for the dynamic coloration of cholesteric networks. This work is expected to extend the study of PCLCs as a dynamically tunable optofluidic reflector, visually readable sensor, or compact anti-counterfeit label in response to organic compounds.

Keywords

1. Introduction

During the past few decades, cholesteric liquid crystals (CLCs) with intrinsic helical configuration of molecular directors have great perspectives towards a wide range of advanced photonic applications such as brightness-enhancement devices of liquid crystal (LC) displays, diffractive optical elements, smart windows, mirrorless lasers, and sensors[15]. Thanks to the Bragg reflection of CLCs, which confers nontrivial optical functionalities, significant structural color can be generated to reflect circularly polarized (CP) light with identical handedness in the visible spectrum. In general, the colors of CLCs, exhibited by the selective reflection wavelength, depend on the helical pitch length ($p$) or/and the average refractive index (average RI, $nav$)[68] in response to the external stimuli, such as temperature, electric field, and light irradiation. Also, some organic compounds can be incorporated into CLCs to alter the optical properties directly. The molecular structure of CLCs can be further modified with recognition fragments and utilized to absorb specific analytes. The uptake of specific analytes will affect $p$ and $nav$ and reveal different reflected colors consequently[911]. This feature is beneficial for the detection of volatile samples such as alcohol, amine, and acetone[1214], providing a versatile sensing platform with several advantages like low cost, being power-free, and naked-eye detection.

However, two main limitations still exist in low molar mass CLCs and should be overcome in colorimetric methods, that is, the durability problem caused by fluidity, which makes them difficult to be prepared as portable systems, and the temperature-sensitivity problem, which may lead to a false-positive response. To address the above-mentioned issues, studies on recording and stabilizing the helical arrangement through the employment of mechanically robust polymer networks have attracted extensive attentions[1518]. Reactive mesogens (RMs) can passively “freeze” the anisotropic phase in the polymerization process to form a rigid porous structure. Notably, a number of pioneering works have exploited the concept of adopting cholesteric scaffolds as polymer templates to imprint supramolecular helical structures based on the multi-step “wash-out/refill” strategy[1921]. Novel cholesteric composites have been achieved by refilling different organic compounds, e.g., nematic and cholesteric mixtures, photoactive nematic copolymer, or optical adhesive. Very recently, Zheng et al. evaluated the interaction between the solvent and the polymer network by monitoring the shift of spectral reflection bands, providing a remarkable understanding of the micro-environmental chemical physics effect[22].

In this work, we report on the optical response of polymerized CLC (PCLC) networks templated by the “wash-out/refill” method in the presence of organic compounds. The dynamic coloration was facilitated by two key approaches to diffuse organic compounds into the polymerized cholesteric networks. The first one is based on the alternative injection of two mutually soluble fluids, that is, a nematic LC (NLC) E7 and an organic solvent benzyl alcohol (BA), into a microfluidic channel and refilling the cholesteric scaffold integrated within in turn, therefore enabling real-time and reversible tunability. The second one is to explore the diffusion and interaction between PCLC networks and representative volatile organic compounds (VOCs, using alcohol as a model compound) with low concentration. This work is expected to extend the study of PCLCs as a dynamically tunable optofluidic reflector, visually readable sensor, or compact anti-counterfeit label in response to organic compounds.

2. Experiments and Methods

The LC/monomer premixture was composed of E7 (71.8% mass fraction), R5011 (2.2%), RMs (25%), and photoinitiator Irgacure 651 (1%). RMs were made up of RM257, RM82, RM006, RM021, and RM010, with a weight ratio of 3:2:2:2:1[23]. Two indium tin oxide (ITO) glass substrates were spin-coated with SD1 to form photoalignment layers before being bonded together using a 20-µm-thickness double-sided adhesive tape. Then, the LC cell was irradiated by linearly polarized visible light (LPVL, 405 nm, $50 mW/cm2$, 50 min) [Fig. 1(a-i)]. The premixture flew into the LC cell by means of capillary force at a temperature above the clear point (90°C). After being cooled down to room temperature slowly, both the reactive and nonreactive monomers were aligned in the planar state and showed standing helical structures [Fig. 1(a-ii)]. After the exposure under UV light (365 nm, $70 mW/cm2$, 10 min), the acrylate end groups of RMs were photopolymerized to form polymer network skeletons. As shown in Figs. 1(a-iii) and 1(a-iv), the unreacted RMs and E7 molecules also acting as pore-forming additives were removed in the following “wash-out” step by the permeation and exchange of organic solvents, and the cholesteric scaffolds can be readily refilled.

Figure 1.Microfluidic infiltration of PCLC networks. (a) Fabrication of PCLC networks enclosed with microchannel: (i) photoalignment with SD1 coated on glass substrates, (ii) self-assembly of CLCs into helical structures, (iii) UV-induced polymerization, (iv) cholesteric scaffolds after the wash-out procedure, (v) fabrication of microfluidic device, (vi) cholesteric scaffolds after the refill procedure. (b) Solubility test of E7 and BA in glass vial. (c) Stratification of E7 and BA in the serpentine channel of the microfluidic device.

Elastic polydimethylsiloxane (PDMS) is an excellent choice for preserving optical properties of PCLC networks in microfluidic operation. Photoresist SU-8 was used in the design and fabrication of microchannels by soft lithography. The microfluidic device consists of two injection ports, a serpentine channel for fluid mixing, and a rectangular region of $20 mm×3 mm×0.1 mm$ for containing PCLCs [Fig. 1(a-v)]. Several meticulous manipulations were required in the integration of PCLC films into microfluidic channels. The PCLC film that adhered firmly to the substrate close to UV exposure was washed thoroughly in ethanol, reshaped carefully by a blade to fit in the rectangular region, and bonded immediately after oxygen plasma treatment.

3. Results and Discussion

In the microfluidic experiments, E7 ($nav=1.64$) flowed in the microchannel at a controlled flow rate by using a syringe pump, infiltrating the cholesteric scaffold, which was washed and refilled with BA ($n=1.54$) beforehand [Fig. 1(a-vi)]. BA was chosen because of its miscibility with E7, higher boiling point, and weaker volatility compared with other commonly used organic solvents like acetone, alcohol, etc. However, the mixing time should be prolonged because of a higher viscosity coefficient. As shown in Fig. 1(b), although hand shaking will accelerate the dissolution process, E7 and BA are initially separate in two layers due to slow diffusion. According to the Einstein–Smoluchowski equation and the Stokes–Einstein equation, the mutual diffusion distance $Δx$ of E7 and BA molecules could be calculated as[24]$〈(Δx)2〉=2D·t,$$D=kiT/6πηia=C/ηi,$where $D$ is the diffusion coefficient, and $t$ is diffusion time. The constant $C$ includes Boltzmann constant $ki$, absolute temperature $T$, and molecular size $α$. Thus, it can be seen that the diffusion coefficient $D$ is negatively correlated with the viscosity coefficient $ηi$. As shown in Fig. 1(c), by the injection of E7 with high $ηi$, BA molecules in the gap between the channel wall and the PCLC film were completely pushed out in a stratified form due to the limited $Δx$.

Figure 2 shows the reflectance spectra measured at different fabrication stages by using a fiber spectrometer (Ocean Optics USB4000). The blue-shift of the reflection band occurred after the polymerization because of the shrinkage of film thickness, and the resulting contraction of helical pitch of the PCLC network formed on one single substrate as the tethering force from the other substrate was absent[15]. Actually, the concentration of RMs was optimized to avoid the severe collapse of the helical polymer network when being fully dried to a sponge-like structure with dense nanopores. For a perpendicular incidence, the central wavelength of Bragg reflection ($λ$) and the reflection bandwidth ($Δλ$) of CLCs are the following: $λ=nav·p,$$Δλ=Δn·p=(ne−no)·p,$where $nav$ is the average RI, $p$ is the helical pitch, and $Δn$ is the anisotropy of RI, which can be calculated by subtracting ordinary RI ($no$) from extraordinary RI ($ne$). The substitution of organic compounds not only influences the overall $nav$ but also $p$ in terms of different swelling/deswelling effects of the CLC helical structure due to the differences in molecular affinity when incorporated in the porous cholesteric scaffold. Once NLC E7 infiltrated the dried film, the CLC film did not swell to its initial state due to a balance between elastic recovery and unexpected loss of unreacted RMs that are removed. This interpreted the phenomena where the reflection band cannot return to the initial wavelength position before the “wash-out” step. The inset shows the micrographs observed using a metallographic microscope (Nikon CM-70 L) at different fabrication stages.

Figure 2.Reflection spectra of the PCLC network during the “wash-out/refill”’ procedure. The inset shows the corresponding micrographs in reflection mode.

By injecting E7 and BA alternatively, $λ$ can be varied between $∼450 nm$ and $∼600 nm$ reversibly, covering the chromaticity space from blue to orange, in less than 2 min for the flow velocity of 20 µL/min [Figs. 3(a) and 3(b)]. The reflection intensity is increased by injecting E7 with higher RI and $Δn$. Moreover, as shown in Figs. 3(c) and 3(d), we compared the influence of flow velocities (20, 40, 60, and 80 µL/min) on the normalized wavelength shift factor ($ΔW/ΔWmax$), which reflects the relative position of wavelength shift. Here, $ΔW$ is defined as the difference between the varying reflection center wavelength and the minimum value, and $ΔWmax$ is a constant value calculated from the difference between the maximum and the minimum value of the reflection center wavelength. Apparently, the time interval at which the reflective band shifts gradually decreases as the flow velocity increases.

Figure 3.Characterization of the dynamic coloration of PCLC networks by microfluidics. Reflection spectra of the PCLC network by injecting (a) E7 and (b) BA at a fixed flow velocity of 20 µL/min. The normalized wavelength of the reflection maximum recorded as a function of time at different fluid velocities by injecting (c) E7 and (d) BA and the corresponding Boltzmann fitting curves. The insets show the corresponding relationship between ηmax and the flow velocity. Illustration of the microstructure of PCLC network when injecting (e) E7 and (f) BA.

As shown in the insets of Figs. 3(c) and 3(d), the maximum change rate of $ΔW/ΔWmax$, namely the maximum slope of the fitting curves in Figs. 3(c) and 3(d), was expressed as $ηmax$ and also monitored at different flow velocities. E7 with a higher viscosity coefficient would have a larger friction resistance and smaller diffusion coefficient in the porous polymer network, leading to a lower $ηmax$. Conversely, for BA with a lower viscosity coefficient, the diffusion coefficient should be larger, and the shift of the reflection band to the short wavelength was accelerated. The results coincide well with the prediction by analyzing the mutual diffusion distance from Eq. (2). In addition, $ηmax$ was connected with the flow velocity of the injected solution in both cases. The increase of flow velocity also leads to the concentration difference maintained at peak level, which facilitates the diffusion process at the interface between the PCLC film and the fluid. As depicted in Figs. 3(e) and 3(f), the changes of $nav$ and $p$ dominate the variation of the reflection band[25]. The swelling process of the network in E7 was possibly slow. Remarkably, in the case of injecting BA, the blue-shift rate of the reflection band was accelerated with the decreasing $p$ in the relatively fast deswelling process.

Furthermore, to exhibit the dynamic coloration by the diffusion of VOCs, the as-prepared UV-PCLC films with retained helical skeleton in double-open-ended glass cells with a thickness of 20 µm were subject to the volatilization of alcohol in a home-made sealed chamber. In the chamber, 10 g of alcohol ($n=1.36$) was put ($10 cm×10 cm×5 cm$) and volatilized at room temperature, allowing the diffusion of alcohol molecules into the glass cell from one open end and the infiltration of the PCLC film. As shown in Figs. 4(a)4(d), when alcohol with lower RI was diffused into the film, the wavelength of the main reflection center blue-shifted from $∼630 nm$ to $∼440 nm$. The variation of reflection spectra can be well explained by Fig. 4(e), which reveals that the diffusion of alcohol in the PCLC film might possibly experience four stages within 10 h.

Figure 4.Characterization of the dynamic coloration of PCLC networks by the diffusion of VOCs. (a)–(d) Four-stage reflection spectra of the PCLC network by the volatilization of alcohol. The corresponding insets show: the dependence of cell thickness on diffusion time, the evolution of reflection spectra of the polymer-poor sample fabricated by UV irradiation for 2 s, the blue-shift of the minor reflection band contributed by the polymer-poor layer, and the blue-shift of the major reflection band contributed by the polymer-rich layer, respectively. (e) Illustration of the microstructure of the PCLC network by the diffusion of alcohol vapor.

In Stage a, an unexpected slight red-shift of the main reflection band was observed within the first 30 min, ascribed to the elongation of $p$ due to the swelling of adhesive tapes used to assemble the glass cell. The inset of Fig. 4(a) illustrates the dependence of the thickness of an empty LC cell on the diffusion time of ethanol. The pitch $p$ increased and tended to be stable at a value of $p1$ after 60 min.

The uneven distribution of the polymer network was caused by UV exposure. The polymer-rich layer could be formed close to the UV light, while the polymer-poor layer is on the other side[2628]. In Stage b, as shown in Fig. 4(b), the rise in the two reflection peaks at 455 nm and 590 nm was accompanied by a decrease in the reflection peak at 640 nm, which was caused by the disappearance of the original pitch $p1$ along with the appearance of two decreased pitches ($p2$ and $p3$). Ethanol molecules tended to diffuse along the interfaces between the PCLC film and both substrates. The infiltration of ethanol deswelled the polymer network, initiating the sudden appearance of pitch $p2$ in the polymer-rich layer and $p3$ in the polymer-poor layer. As shown in the inset of Fig. 4(b), a similar evolution of reflection peaks was also observed in the polymer-poor film, which was fabricated by UV irradiation for only 2 s, supporting the aforementioned assumption from another aspect. The relationship of three pitches was $p1>p2>p3$ because the pitch contraction depended on the amount of ethanol refilled in different layers.

In Stage c, as shown in Fig. 4(c), the peak at the major reflection band centered at 590 nm was relatively stable at the long wavelength edge due to the slight change of $nav$ and $Δn$ in the polymer-rich layer. However, the sparse network facilitated the diffusion of ethanol molecules, with a further decrease of $nav$ in the polymer-poor layer and the blue-shift of the minor reflection center from 445 nm to outside the detection range [Fig. 4(c)]. The diminishment of reflection intensity can be ascribed to the decrease of $Δn$. Finally, although the lateral diffusion in the polymer-rich layer from the open end was not evident, when the concentration of alcohol in the polymer-poor layer reached a suitable value, the occurrence of vertical diffusion into the polymer-rich layer was allowed in the following Stage d. The inset in Fig. 4(d) shows the continuous blue-shift of the central wavelength from 590 nm to 440 nm, reflecting the significant decrease of $nav$ in the polymer-rich layer.

Additionally, as shown in Fig. 5, the aforementioned approaches were adopted to infiltrate the cholesteric scaffolds in a uniform and a gradient way, respectively, to endow the 100th anniversary logo of Xiamen University (XMU) with vivid structural colors. A microprojection system based on digital micromirror device (DMD) was used to record the XMU logo[29,30]. In detail, for the approach based on microfluidics, only the logo pattern was fabricated and immobilized in the microchannel. For the VOC diffusion approach in a double-open-ended LC cell, the area outside the logo was cured under UV light at an elevated temperature above the clear point to eliminate structural color, but it still maintained the integrity of the whole network structure in favor of the intact diffusion process of alcohol. By this means, a fascinating iridescence was generated by the volatilization and diffusion of alcohol. To be more specific, the XMU logo appeared with a red color brought about by the increase in the number of layers of $p2$ and $p3$ at 35 min (Stage b). Another iridescent logo with gradient colors of orange, yellow, green, and blue was observed at 300 min. More than half of the area showed gradient colors of blue and purple after 600 min (Stage d).

Figure 5.Reflection micrographs of the 100th anniversary logo of XMU fabricated by the PCLC network. (a) Uniform coloration achieved by microfluidics. (b) Gradient coloration induced by the diffusion of alcohol vapor at 35 min, 300 min, and 600 min.

4. Conclusion

In summary, we disclosed the dynamic coloration of the PCLC network facilitated by two key approaches to refill organic compounds, that is, the alternative injection of mutually soluble organic fluids into a microfluidic channel and the diffusion of organic vapor. For the first approach, the relationship between flow velocity of fluid and the optical response was studied, enabling the reversible tuning of reflection color with a central wavelength located between $∼450 nm$ and $∼600 nm$. For the second approach, the influence of the duration time in UV polymerization on optical characteristics was studied and interpreted. A VOC-diffusion-induced blue-shift of the reflection center was revealed from $∼620 nm$ to $∼410 nm$. We anticipate that the class of polymer-templated LC composites with dynamic coloration by infiltrating the cholesteric scaffold with organic compounds can become one of the most promising candidates for dynamically tunable optofluidic reflectors, visually readable sensors, or compact anti-counterfeit labels in response to VOCs.

References

[1] H. K. Bisoyi, Q. Li. Liquid crystals: versatile self-organized smart soft materials. Chem. Rev., 122, 4887(2021).

[2] C. L. Yuan, W. B. Huang, X. Q. Wang, D. Shen, Z. G. Zheng. Electrically tunable helicity of cholesteric heliconical superstructure. Chin. Opt. Lett., 18, 080005(2020).

[3] Y. H. Ge, Y. M. Lan, X. R. Li, Y. W. Shan, Y. J. Yang, S. S. Li, C. Y. Yang, L. J. Chen. Polymerized cholesteric liquid crystal microdisks generated by centrifugal microfluidics towards tunable laser emissions. Chin. Opt. Lett., 18, 080006(2020).

[4] Y. S. Zhang, Z. Q. Wang, W. C. Chuang, S. A. Jiang, T. S. Mo, J. D. Lin, C. R. Lee. Programmable engineering of sunlight-fueled, full-wavelength-tunable, and chirality-invertible helical superstructures. ACS Appl. Mater. Interfaces, 13, 55550(2021).

[5] Z. X. Li, Y. P. Ruan, P. Chen, J. Tang, W. Hu, K. Y. Xia, Y. Q. Lu. Liquid crystal devices for vector vortex beams manipulation and quantum information applications. Chin. Opt. Lett., 19, 112601(2021).

[6] R. Balamurugan, J. H. Liu. A review of the fabrication of photonic band gap materials based on cholesteric liquid crystals. React. Funct. Polym., 105, 9(2016).

[7] X. J. Liu, L. Qin, Y. Y. Zhan, M. Chen, Y. L. Yu. Phototuning of structural colors in cholesteric liquid crystals. Acta Chim. Sin., 78, 478(2020).

[8] C. T. Xu, P. Chen, Y. H. Zhang. Tunable band-pass optical vortex processor enabled by wash-out-refill chiral superstructures. Appl. Phys. Lett., 118, 151102(2021).

[9] Y. Kim, N. Tamaoki. Photoresponsive chiral dopants: light-driven helicity manipulation in cholesteric liquid crystals for optical and mechanical functions. ChemPhotoChem, 3, 284(2019).

[10] S. Hussain, S. Y. Park. Optical glucose biosensor based on photonic interpenetrating polymer network with solid-state cholesteric liquid crystal and cationic polyelectrolyte. Sens. Actuators B Chem., 316, 128099(2020).

[11] K. G. Noh, S. Y. Park. Biosensor array of interpenetrating polymer network with photonic film templated from reactive cholesteric liquid crystal and enzyme-immobilized hydrogel polymer. Adv. Funct. Mater., 28, 1707562(2018).

[12] C. K. Chang, C. M. W. Bostiaansen, D. J. Broer, H. L. Kou. Alcohol-resonsive, hydrogen-bonded, cholesteric liquid-crystal networks. Adv. Funct. Mater., 22, 2855(2012).

[13] J. E. Stumpel, C. Wouters, N. Herzer, J. Ziegler, D. J. Broer, C. W. M. Bastiaansen, A. P. H. J. Schenning. An optical sensor for volatile amines based on an inkjet-printed, hydrogen-bonded, cholesteric liquid crystalline film. Adv. Opt. Mater., 2, 459(2014).

[14] Y. H. Yang, D. Zhou, X. J. Liu, Y. J. Liu, S. Q. Liu, P. X. Miao, Y. C. Shi, W. M. Sun. Optical fiber sensor based on a cholesteric liquid crystal film for mixed VOC sensing. Opt. Express, 28, 31872(2020).

[15] J. B. Guo, H. Cao, J. Wei, D. W. Zhang, F. Liu, G. H. Pan, D. Y. Zhao, W. L. He, H. Yang. Polymer stabilized liquid crystal films reflecting both right- and left-circularly polarized light. Appl. Phys. Lett., 93, 201901(2008).

[16] W. S. Li, C. Yang, B. Luo, Z. Y. Wang, X. Q. Wang, Y. K. Bo, S. S. Li, H. Y. Xu, L. J. Chen. Effect of preparation parameters on the performance pf polymer-stabilized cholesteric liquid crystals for laser emission. Chin. Opt. Lett., 12, 111602(2014).

[17] C. L. Sun, J. G. Lu. Effect of sectional polymerization process on tunable twist structure liquid crystal filters. Crystals, 9, 268(2019).

[18] L. Y. Mo, H. T. Sun, A. H. Liang, X. F. Jiang, L. L. Shui, G. F. Zhou, L. T. de Haan, X. W. Hu. Multi-stable cholesteric crystal windows with four optical states. Liq. Cryst., 49, 289(2021).

[19] Y. Li, D. Luo. Fabrication and application of 1D micro-cavity film made by cholesteric liquid crystal and reactive mesogen. Opt. Mater. Express, 6, 691(2016).

[20] X. Y. Zhan, H. P. Fan, Y. Li, Y. J. Liu, D. Luo. Low threshold polymerised cholesteric liquid crystal film lasers with red, green and blue colour. Liq. Cryst., 46, 970(2019).

[21] Z. K. Zhu, Y. Gao, J. G. Lu. Multi-pitch liquid crystal filters with single layer polymer template. Polymers, 13, 2521(2021).

[22] N. Shen, M. T. Hu, X. Q. Wang, P. Z. Sun, C. L. Yuan, B. H. Liu, D. Shen, Z. G. Zheng, Q. Li. Cholesteric soft matter molded helical photonic architecture toward volatility monitoring of organic solvent. Adv. Photon. Res., 2, 2100018(2021).

[23] Y. W. Shan, L. Q. You, H. K. Bisoyi, Y. J. Yang, Y. H. Ge, K. J. Che, S. S. Li, L. J. Chen, Q. Li. Annular structural colors from bowl-like shriveled photonic microshells of cholesteric liquid crystals. Adv. Opt. Mater., 8, 2000692(2020).

[24] K. N. Fan. Physical Chemistry(2021).

[25] J. D. Lin, C. L. Chu, H. Y. Lin, B. You, C. T. Horng, S. Y. Huang, T. S. Mo, C. Y. Huang, C. R. Lee. Wide-band tunable photonic bandgaps based on nematic-refilling cholesteric liquid crystal polymer template samples. Opt. Mater. Express, 5, 1419(2015).

[26] D. J. Broer, J. Lub, G. N. Mol. Wide-band reflective polarizers from cholesteric polymer networks with a pitch gradient. Nature, 378, 467(1995).

[27] J. Kim, H. Kim, S. Kim, S. Choi, W. Jang, J. Kim, J. H. Lee. Broadening the reflection bandwidth of polymer-stabilized cholesteric liquid crystal via a reactive surface coating layer. Appl. Opt., 56, 5731(2017).

[28] H. Kim, J. Kim, S. Kim, J. Kim, J. H. Lee. Effect of the radio between monoacrylate and diacrylate reactive mesogen on the transmission spectrum of polymer-stabilized cholesteric liquid crystal. Opt. Mater. Express, 8, 97(2018).

[29] L. L. Ma, S. B. Wu, W. Hu, C. Liu, P. Chen, H. Qian, Y. D. Wang, L. F. Chi, Y. Q. Lu. Self-assembled asymmetric microlenses for four-dimensional visual imaging. ACS Nano, 13, 13709(2019).

[30] X. Y. Fan, W. Y. Ma, Y. M. Zhang, C. T. Xu, H. Ren, W. M. Han, C. Y. Chen, W. Hu. Broadband spatial polarization processing of light via a photopatterned dichroic medium. Appl. Phys. Lett., 120, 041103(2022).

Tools

Get Citation

Copy Citation Text

Yu Cao, Li Chong, Ke-Hui Wu, Lu-Qian You, Sen-Sen Li, Lu-Jian Chen. Dynamic coloration of polymerized cholesteric liquid crystal networks by infiltrating organic compounds[J]. Chinese Optics Letters, 2022, 20(9): 091602

EndNote(RIS)BibTexPlain Text
Paper Information

Category: Optical Materials


text:
# Dynamic filter in real time audio

Following my previous question: Removing cracking in real time audio, I'm trying to implement a dynamic filter in real time audio.

What I want to do is to create a filter where I can change the cut-off frequency at run time. So far I have implemented a simple code which adds 10Hz to the cut-off frequency at ach iteration. The code is the following and works fine:

import pyaudio
import wave
import time
import numpy as np
import scipy.io.wavfile as sw
import librosa
import scipy.signal
import scipy
import sys
from scipy.io.wavfile import write

############ Global variables ###################
filename = '../wav/The_Weeknd.wav' #Test file
chunk = 512 #frame size
#Conversion from np to pyAudio types
np_to_pa_format = {
np.dtype('float32') : pyaudio.paFloat32,
np.dtype('int32') : pyaudio.paInt32,
np.dtype('int16') : pyaudio.paInt16,
np.dtype('int8') : pyaudio.paInt8,
np.dtype('uint8') : pyaudio.paUInt8
}
np_type_to_sample_width = {
np.dtype('float32') : 4,
np.dtype('int32') : 4,
np.dtype('int16') : 3,
np.dtype('int8') : 1,
np.dtype('uint8') : 1
}
STEREO = 2 #channels
#################################################

# Simple class which reads an input test wav file and reproduce it in a real time fashion. Used to test real time functioning.
class Player:
def __init__(self):
self.input_array, self.sample_rate = librosa.load(filename, sr=44100, dtype=np.float32, offset=30, duration=60)

#print(self.sample_rate)
#print(self.input_array.shape)
self.cycle_count = 0
self.highcut = 300
self.filter_state = np.zeros(4)

def bandPassFilter(self,signal, highcut):
fs = 44100
lowcut = 20
highcut = highcut

nyq= 0.5 * fs
low = lowcut / nyq
high = highcut / nyq

order = 2

b, a = scipy.signal.butter(order, [low,high], 'bandpass', analog=False)

y, self.filter_state = scipy.signal.lfilter(b,a,signal, axis=0, zi=self.filter_state) # NB: filtfilt needs forward and backward information to filter. So it can't be used in realtime filtering where i have no info about future samples! lfilter is better for real time applications!
return(y)

def pyaudio_callback(self,in_data, frame_count, time_info, status):
audio_size = np.shape(self.input_array)[0]
#print(audio_size)
#print('frame count: ', frame_count)

if frame_count*self.cycle_count > audio_size:
# Processing is complete.
#print('processing complete')
return (None, pyaudio.paComplete)
elif frame_count*(self.cycle_count+1) > audio_size:
# Last frame to process.
#print('1 left frame')
frames_left = audio_size - frame_count*self.cycle_count
else:
# Every other frame.
#print('everyotherframe')
frames_left = frame_count

data = self.input_array[frame_count*self.cycle_count:frame_count*self.cycle_count+frames_left]
data = self.bandPassFilter(data, self.highcut)
if(self.highcut<20000):
self.highcut += 10

#print('len of data', data.shape)

#write('test.wav', 44100, data) #Saves correctly the file!
out_data = data.astype(np.float32).tobytes()
#print('printing length: ',len(out_data))
#print(out_data)
self.cycle_count+=1
#print(self.cycle_count)
#print('pyaudio continue value: ',pyaudio.paContinue)
return (out_data, pyaudio.paContinue)

def start_non_blocking_processing(self, save_output=True, frame_count=2**10, listen_output=True):
'''
Non blocking mode works on a different thread, therefore, the main thread must be kept active with, for example:
while processing():
time.sleep(1)
'''
self.save_output = save_output
self.frame_count = frame_count

# Initiate PyAudio
self.pa = pyaudio.PyAudio()
# Open stream using callback
self.stream = self.pa.open(format=np_to_pa_format[self.input_array.dtype],
channels=1,
rate=self.sample_rate,
output=listen_output,
input=not listen_output,
stream_callback=self.pyaudio_callback,
frames_per_buffer=frame_count)

# Start the stream
self.stream.start_stream()

def processing(self):
'''
Returns true if the PyAudio stream is still active in non blocking mode.
MUST be called AFTER self.start_non_blocking_processing.
'''
return self.stream.is_active()

def terminate_processing(self):
'''
Terminates stream opened by self.start_non_blocking_processing.
MUST be called AFTER self.processing returns False.
'''
# Stop stream.
self.stream.stop_stream()
self.stream.close()

# Close PyAudio.
self.pa.terminate()

# Resets count.
self.cycle_count = 0
# Resets output.
self.output_array = np.array([[], []], dtype=self.input_array.dtype).T

if __name__ == "__main__":
print('RUNNING MAIN')
player = Player()
player.start_non_blocking_processing()
while(player.processing()):
time.sleep(0.1)
player.terminate_processing()

As another user suggested me in my previous answer, it is not a great idea to re-create the filter in the callback function at each iteration, this could lead to problems and useless extra computations.

I have been trying to find a nicer solution beside re-create the whole filter with the new cut-off frequency, but I haven't been able to find anything better.

Is there a way (using scipy for example) to change the cut-off frequency at run time without re-create the whole filter?

• How exact does the highcut need to be? Changing what filter you’re using on the fly should not be the expensive part, a convolution is a convolution to the computer irrespective of whether it has used a particular filter before. The expensive part is probably recalculating the IIR filter values. Two options are to do that upfront and create filters for a range of highcut values and use a lookup table, or do it out-of-band in a separate thread while the player continues to process until the new filter is ready. – Keegs Dec 29 '20 at 15:09
• Yes, the problem is that I don't know how to change the filter without re-compute the whole filter. Anyway, since in the final project it should be an arbitrary cut-off frequency (imagine like a DAW with a filter, as final user you can change the the cut-off value how much you want and whenever you want while the audio in playing). Wouldn't it be too memory expensive to compute a whole look-up table for all the possible cut-off values? Expecially if this is extended to multiple filters – Mattia Surricchio Dec 29 '20 at 17:26

A few suggestions:

1. I would do all filter design with poles and zeros, NOT with filter coefficient
2. Implement everything as second order sections, with one complex pole pair per section.
3. The zeros of a Butterworth filter are constant: they are at $$z = 1, z= -1$$. You don't need to explicitly calculate the $$b$$ coefficients of your filter. It's always $$b = [1, 2 ,1]$$ or $$[1, -2, 1]$$ plus a single gain
4. For any complex pole, $$p$$, you the denominator coefficients are simply $$a_0 =1$$, $$a_1 = -2 Re\{p\}$$, $$a_2= p \cdot p'$$
5. The poles of an analog Butterworth filter are uniformly distributed on the left half of the unit circle in the s-plane. That can be easily mapped to the z-plane through the bilinear transform for the specific cutoff frequency. That involves one transcendental function call and one division. Not cheap , but also not overly expensive either
6. If that's too expensive, you can table up the pole locations over your desired frequency range. Then interpolate or do an polynomial fit. Interpolation of the pole location is perfectly safe, interpolation of the filter coefficients is risky.
7. Your filter is time variant, which can induce "zipper" noise on any update. A lot of the noise comes through a change of the transfer functions to/from the state variables. The best way to minimize that effect is to use a Direct Form I topology for the filter, since the state variables are just the inputs and outputs and NOT dependent on the transfer function. Transposed form II is also usable (but not as good) and the other two topologies can be outright terrible.
8. Writing your own Direct Form I Butterworth filter could also be cheaper than using $$lfilter()$$ since you can skip all multiplications with the $$b$$ coefficients. On the other hand, someone probably already optimized the living daylights of lfilter() so it depends.
9. You will still need to constrain the speed of the update and how fast the poles can move from frame to frame. One simple way to do this is to throw a first order lowpass filter on the pole location itself. It's very cheap to implement and you can dial in the time constant of the lowpass filter to optimize the speed of the update while avoiding any unacceptable update noises.
10. Depending on how low you want to go (in frequency), you may need to go extra slow as the poles approach $$z=1$$. They can get awfully close to the unit circle and even small pole changes result in large frequency jumps. If that's a problem, you may have to warp the frequency axis, but this is not for the faint of heart and since your filter order is quite low, you may get away without it.
• Whoa these are a lot of informations! Really appreciated. I am not an expert so I'm missing some points, but I kind of understood the general idea. So basically I should move to pole/zeros representation (it should be more numerically stable). If I want to stick to the available library, this still force me to re-define the whole filter every time I want to change the cut-off frequency right? So recompute the b coefficient and then apply lfilter, and this has to be done every single time I want to change my cut-off frequency – Mattia Surricchio Dec 29 '20 at 17:45
• You’re asking how to make a filter with an arbitrary cutoff frequency without making a filter. It’s Sine Qua Non; you can’t make something without making it. There is going to be computation involved every time that filter changes. My suggestion is you push off the recompute to another thread if you don’t want it blocking your playback. – Keegs Dec 29 '20 at 18:08
• @AnalogEE Makes perfectly sense, my doubts arise from my previous question where they pointed out that it was a bad idea to re-create the filter each time, but I didn't find any solution that didn't involve to re-compute the whole filter – Mattia Surricchio Dec 29 '20 at 19:36
• There are two problems that need solving: updating the filters "fast enough" and applying a time variant filter without creating artifact. The best way for the update depends a bit on the frame size and how quickly/often the filters needs to be updated. You can certainly shove it in different thread, if the update rate is slow enough, but I think it can be done in real time for frames size of say 256 samples or above – Hilmar Dec 29 '20 at 19:44
• this deserves more upvotes than 2. – robert bristow-johnson Dec 29 '20 at 21:00


text:
# sbyte (C# Reference)

sbyte denotes an integral type that stores values according to the size and range shown in the following table.

Type Range Size .NET type
sbyte -128 to 127 Signed 8-bit integer System.SByte

## Literals

You can declare and initialize an sbyte variable by assigning a decimal literal, a hexadecimal literal, or (starting with C# 7.0) a binary literal to it.

In the following example, integers equal to -102 that are represented as decimal, hexadecimal, and binary literals are converted from int to sbyte values.

sbyte sbyteValue1 = -102;
Console.WriteLine(sbyteValue1);

unchecked {
sbyte sbyteValue2 = (sbyte)0x9A;
Console.WriteLine(sbyteValue2);

sbyte sbyteValue3 = (sbyte)0b1001_1010;
Console.WriteLine(sbyteValue3);
}
// The example displays the following output:
//          -102
//          -102
//          -102

Note

You use the prefix 0x or 0X to denote a hexadecimal literal and the prefix 0b or 0B to denote a binary literal. Decimal literals have no prefix.

Starting with C# 7.0, a couple of features have been added to enhance readability.

• C# 7.0 allows the usage of the underscore character, _, as a digit separator.
• C# 7.2 allows _ to be used as a digit separator for a binary or hexadecimal literal, after the prefix. A decimal literal isn't permitted to have a leading underscore.

Some examples are shown below.

unchecked {
sbyte sbyteValue4 = (sbyte)0b1001_1010;
Console.WriteLine(sbyteValue4);

sbyte sbyteValue5 = (sbyte)0b_1001_1010;       // C# 7.2 onwards
Console.WriteLine(sbyteValue5);
}
// The example displays the following output:
//          -102
//          -102

If the integer literal is outside the range of sbyte (that is, if it is less than SByte.MinValue or greater than SByte.MaxValue, a compilation error occurs. When an integer literal has no suffix, its type is the first of these types in which its value can be represented: int, uint, long, ulong. This means that, in this example, the numeric literals 0x9A and 0b10011010 are interpreted as 32-bit signed integers with a value of 156, which exceeds SByte.MaxValue. Because of this, the casting operator is needed, and the assignment must occur in an unchecked context.

## Compiler overload resolution

A cast must be used when calling overloaded methods. Consider, for example, the following overloaded methods that use sbyte and int parameters:

public static void SampleMethod(int i) {}
public static void SampleMethod(sbyte b) {}

Using the sbyte cast guarantees that the correct type is called, for example:

// Calling the method with the int parameter:
SampleMethod(5);
// Calling the method with the sbyte parameter:
SampleMethod((sbyte)5);

## Conversions

There is a predefined implicit conversion from sbyte to short, int, long, float, double, or decimal.

You cannot implicitly convert nonliteral numeric types of larger storage size to sbyte (see Integral Types Table for the storage sizes of integral types). Consider, for example, the following two sbyte variables x and y:

sbyte x = 10, y = 20;

The following assignment statement will produce a compilation error, because the arithmetic expression on the right side of the assignment operator evaluates to int by default.

sbyte z = x + y;   // Error: conversion from int to sbyte

To fix this problem, cast the expression as in the following example:

sbyte z = (sbyte)(x + y);   // OK: explicit conversion

It is possible though to use the following statements, where the destination variable has the same storage size or a larger storage size:

sbyte x = 10, y = 20;
int m = x + y;
long n = x + y;

Notice also that there is no implicit conversion from floating-point types to sbyte. For example, the following statement generates a compiler error unless an explicit cast is used:

sbyte x = 3.0;         // Error: no implicit conversion from double
sbyte y = (sbyte)3.0;  // OK: explicit conversion

For information about arithmetic expressions with mixed floating-point types and integral types, see float and double.

For more information about implicit numeric conversion rules, see the Implicit Numeric Conversions Table.

## C# Language Specification

For more information, see Integral types in the C# Language Specification. The language specification is the definitive source for C# syntax and usage.